>>>>> "d" == dolphin  <[email protected]> writes:

  d> Hi,
  d> I want to use perl and print time before and after sleep but not
  d> successful, can anyone advice?

  d> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime
  d> time;

those variables contain the breakdown of time at the moment.

  d> my $timenow="$hour$min$sec";
  d> print "It is now $timenow\n";
  d> sleep 15;

  d> my $timelater="$hour$min$sec";

why would you think those variables would have the current time? they
still have the values you set before. you need to call the time()
function again to get the current time. variables don't change unless
you assign things to them.

uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to