Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Using Number Ranges in a Dispatch Table

by oko1 (Deacon)
on Feb 19, 2012 at 17:06 UTC ( #954880=note: print w/ replies, xml ) Need Help??


in reply to Re: Using Number Ranges in a Dispatch Table
in thread Using Number Ranges in a Dispatch Table

But isn't this always the case when you're dealing with statements that take lists as arguments?

# Ooops! print join ",", @foo, "\n"; # Ooops! print grep /o/, @foo, "Hello world!\n"; # Ooops! print table{ map { tr(td($_->[0]), td($_->[1])) } @foo, ...

My rule of thumb is, if one of these statements is followed by anything besides its argument, then parenthesize that statement's entire argument list.

# De-oopsed. print join(",", @foo), "\n"; print grep(/o/, @foo), "Hello world!\n"; print table{ map({ tr(td($_->[0]), td($_->[1])) } @foo), ...
-- 
I hate storms, but calms undermine my spirits.
 -- Bernard Moitessier, "The Long Way"


Comment on Re^2: Using Number Ranges in a Dispatch Table
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2015-07-28 01:39 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 (251 votes), past polls