in reply to Re: How to get time in perl?
in thread How to get time in perl?

A little comment gube
Month = 0-based, so to display properly use $month++;
The pragma use Time::Localtime is not needed here, and please use -w and scrict.
eg:
#!/usr/bin/perl -w use strict; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(t +ime); $year = $year + 1900; $mon++; my $x = ""; if($hour > 12) { $hour = $hour - 12; $x = 'PM'; } else { $x = 'AM'; } print "$mday/$mon/$year $hour:$min:$sec $x\n";
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.