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

Re^6: RFC: beginner level script improvement (various comments)

by smls (Friar)
on Nov 05, 2013 at 07:32 UTC ( #1061257=note: print w/replies, xml ) Need Help??


in reply to Re^5: RFC: beginner level script improvement (various comments)
in thread RFC: beginner level script improvement

Yes, you should of course use whatever you feel most comfortable with.

FYI, here are two even shorter ways to write that if clause... ;)

# using a loop: if (@_) { $self->{$_} = shift for qw(stuff1 stuff2 stuff3); } # using a hash slice (probably the fastest alternative): @$self{qw( stuff1 stuff2 stuff3 )} = @_ if @_;

(The @ sigil in front of the $self hashref is not a typo - see Slices for more info on that.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1061257]
help
Chatterbox?
[marto]: Corion, pretty much. How are things? You were at LPW?
[Corion]: marto: Yep, but I didn't make it up north, sorry ;)
[Corion]: But LPW was enjoyable, even though it's always a bit hectic due to cramming everything into one day

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2016-12-07 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (125 votes). Check out past polls.