Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: elegant way of handling hash?

by ambrus (Abbot)
on Jan 19, 2006 at 16:47 UTC ( [id://524280]=note: print w/replies, xml ) Need Help??


in reply to Re^2: elegant way of handling hash?
in thread elegant way of handling hash?

You could try

my %replacehash = ( TEMP1 => $flow->getExeName(), TEMP2 => $flow->getTempName(), TEMP3 => $flow->getData()->getNameType(), )
(If you call a method with no arguments, like here, you could also omit the empty pair of parentheses, but that's not the point here.)

Also

my %replacehash; @replacehash{map { "TEMP$_" } 1 .. 3} = ( $flow->getExeName(), $flow->getTempName(), $flow->getData()->getNameType(), )

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-24 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found