in reply to localtime parse within hash init
You neglect the Time::Piece core module. Enumerating the accessor names yourself is a code smell.
perl -MTime::Piece=localtime -E ' my %stuff = ( otherinfo => "this and that", dateinfo => scalar localtime ); say "sec=", $stuff{dateinfo}->sec, "year=", $stuff{dateinfo}->year '
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: localtime parse within hash init
by NetWallah (Canon) on Nov 07, 2014 at 20:48 UTC |
In Section
Seekers of Perl Wisdom