This would be more clear to you

($sec,$min,$hr,$day,$mon,$year)=localtime(time);
$year +=1900;
$mon=$mon+1;

Urmil

-----Original Message-----
From: Saurabh Singhvi [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:57 AM
To: Perl FAq
Subject: Cant seem to understand


well i cant understand what the $1, $2 and $3 do??
herez the code

#!/usr/local/bin/perl -w

# Get the date in the standard date format. (ex: Tue
Oct 24 19:03:03
1995 )
my $date = localtime();

# Search through the date looking for the hour,
minute, and second.
if ($date =~ /(\d\d):(\d\d):(\d\d)/)
{
   # Save the information.
   my $hours = $1;
   my $minutes = $2;
   my $seconds = $3;
   print "Hours  : $hours \n";
   print "Minutes: $minutes \n";
   print "Seconds: $seconds \n";
}

thanks in advance
Regards
Saurabh

=====
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SAURABH SINGHVI
H-8,ROOM NO.291
IIT BOMBAY
POWAI
MUMBAI
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to