Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: your Perl bug Achilles heel

by wfsp (Abbot)
on Dec 05, 2008 at 07:57 UTC ( [id://728217]=note: print w/replies, xml ) Need Help??


in reply to your Perl bug Achilles heel

Mine is similar to the op. Telling built ins that take a list where the list ends.
my %broken = ( monday => join q{/}, q{one}, q{two}, tuesday => sprintf q{%s%s}, q{three}, q{four}, ); my %better = ( monday => join(q{/}, q{one}, q{two}), tuesday => sprintf(q{%s%s}, q{three}, q{four}), );
Rather than have to remember that parens are needed in this case I tend to use them all the time. If the function's args are on more than one line it gives you something to pin the ; to.
my $str = sprintf( q{%s -> %s}, get_data(), get_more(), );

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-19 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found