Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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
Replies are listed 'Best First'.
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 scrutinizing the Monastery: (11)
As of 2015-07-31 02:07 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 (274 votes), past polls