Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: localtime parse within hash init

by Anonymous Monk
on Nov 07, 2014 at 11:48 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found