in reply to Help with hash of arrays from file
You can simplify the following:
my($day, $month, $year) = (localtime)[3,4,5]; $month = sprintf '%02d', $month+1; $day = sprintf '%02d', $day; $year = $year+1900; $ymd = "$year-$month-$day";
using the Core POSIX module:
use POSIX qw(strftime); my $ymd = strftime('%Y-%m-%d', localtime);
Please change your "pre" tags to "code" tags.
|
|---|