Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Shortcut operator for $a->{'b'}=$b if $b;

by rir (Vicar)
on Sep 21, 2005 at 04:03 UTC ( #493650=note: print w/ replies, xml ) Need Help??


in reply to Shortcut operator for $a->{'b'}=$b if $b;

{ $hash{data} = $_ if defined ( local $_ = $something ); }

A simple if-block is not to be faulted but if you are going to use a single statement a large $something should come last; else it will obscure following logic.

With the above it is easy to forget to close a scope over the local.

Be well,
rir


Comment on Re: Shortcut operator for $a->{'b'}=$b if $b;
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2015-07-28 11:10 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 (254 votes), past polls