Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: hash n' params

by araqnid (Beadle)
on Apr 07, 2001 at 20:38 UTC ( #70727=note: print w/ replies, xml ) Need Help??


in reply to hash n' params

When you're initialising a hash that contains a group of settings, you can put them together like this:

my %exec = ( html2ps => '/usr/bin/html2ps', ps2pdf => '/usr/bin/ps2pdf', html2text => '~/perl/html2text' );
which IMHO looks nicer. You're explicitly allowed to use barewords on the left hand side of a =>, even if "use strict" is in force.


Comment on Re: hash n' params
Download Code
Replies are listed 'Best First'.
Re (tilly) 2: hash n' params
by tilly (Archbishop) on Apr 08, 2001 at 00:02 UTC
    Warning. A bug I recently learned about:
    use strict; my %trial_hash = ( foo => "bar", );
    does not run properly in a Perl program, but does if you use eval. So while I use the "big arrow", you should put it on the same line as the key, not the value.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2015-07-30 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls