Hi all, I'm trying to write a script to run via cron to delete expired sessions.
When run, i get this error: Odd number of elements in hash assignment at /usr/lib/perl5/site_perl/5.8.7/CGI/Session.pm line 123.
Use of uninitialized value in list assignment at /usr/lib/perl5/site_perl/5.8.7/CGI/Session.pm line 124.
Here's my code:
#!/usr/bin/perl -w
use strict; use CGI::Session;
my $dsn_args = {
DataSource => 'DBI:mysql:timor3_yourspace:localhost', User => 'timor3_dhoss', Password => 'lairdo' };
CGI::Session->find( $dsn_args, \&purge );
sub purge {
my ($session) = @_; next if $session->is_empty; # <-- already expired?! if ( ($session->atime + 900 ) <= time() ) { $session->delete() or warn "couldn't remove " . $session->id . ": " . $session->errstr;
} }
Any ideas?
-devin
-- timorperfectus.com - web design to frightening perfection.
One last song Given to an Angel's Son As soon as you were gone As soon as you were gone
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/ _______________________________________________
Cgi-session-user mailing list
Cgi-session-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/cgi-session-user
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|