in reply to Re: Re: Current time as variable?
in thread Current time as variable?
my $start; my $end; &starttime; &stoptime; sub starttime{ $start = time; sleep 5; } sub stoptime{ $end = time; print $end - $start."\n"; }
Update: If you'd put "use strict;" in the beginning of your little snippet, Perl would warn you about this with: Global symbol "$start" requires explicit package name at test line 14.
|
|---|