Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: localtime parse within hash init

by Anonymous Monk
on Nov 07, 2014 at 11:48 UTC ( #1106478=note: print w/replies, xml ) Need Help??


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
    Excellent ! - thank you. I'll incorporate that in.

            "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-08-15 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?