#!/usr/bin/perl -w my $s=MakeID(); print "sid="$s\"\n"; sub MakeID { # Seed the random generator srand($$|time); $sessionID=int(rand(60000)); # pack the time, process id, and random $session into a # hex number which will make up the sessin ID $session=unpack("H*", pack("Nnn", time, $$, $sessionID)); return $session; } #Make ID