Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Module Announcement: Perl-Critic-1.01

by holli (Monsignor)
on Jan 26, 2007 at 15:14 UTC ( #596723=note: print w/ replies, xml ) Need Help??


in reply to Re: Module Announcement: Perl-Critic-1.01
in thread Module Announcement: Perl-Critic-1.01

Returning an explicit undef can be a problem if the sub gets called in list context. Because then the return value will be a one element list containing an undef, which would evaluate to "true" and that is in most cases not what you want. A naked return; dwims in scalar and list contexts.



holli, /regexed monk/


Comment on Re^2: Module Announcement: Perl-Critic-1.01
Select or Download Code
Re^3: Module Announcement: Perl-Critic-1.01
by Spooner (Acolyte) on Jan 30, 2007 at 02:35 UTC
    the return value will be a one element list containing an undef, which would evaluate to "true" and that is in most cases not what you want.
    Boolean list context? I'm baffled as to what case you are concerned about. As to "most cases", I quibble. Some, but not most.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-09-20 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (157 votes), past polls