in reply to Re: localtime parse within hash init
in thread localtime parse within hash init
That leads to:
Which works, is pretty decent, and free of external modules.perl -E 'my %stuff=(otherinfo=>"this and that", dateinfo=> sub{ my %r; @r{qw|sec min hour mday mon year wday yday isdst|} =localtime(time); return \%r}->()); say "sec=",$stuff{dateinfo}{sec}, " year=",$stuff{dateinfo}{year}'
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
|
|---|