#!/usr/bin/perl -w use strict; use DBI; use Serialize; # NOTE!!!! # The Serialize module is not found on CPAN # it was found with a google search; # you can download it here: # http://furt.com/code/perl/serialize/ use Storable qw(freeze thaw); my $id = $ARGV[0]; my $db = DBI->connect("DBI:mysql:sessions", "root", "" ); my $sel = $db->prepare("SELECT a_session FROM sessions WHERE id='$id'"); $sel->execute; my @data = $sel->fetchrow_array; if ( $data[0] ) { my $ref = thaw($data[0]); print "session|" . serialize($ref); } else { print ""; } $sel->finish; $db->disconnect;