Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: (crazyinsomniac) Re: Coding superstitions

by blakem (Monsignor)
on Jan 09, 2002 at 00:24 UTC ( #137242=note: print w/ replies, xml ) Need Help??


in reply to Re: (crazyinsomniac) Re: Coding superstitions
in thread Coding superstitions

Assuming you don't mind returning 1/undef instead of 1/0 I'd prefer this:
sub fred { $_[0] eq 'ooyah' }
Or, if you want to keep your '0', how about:
sub fred { $_[0] eq 'ooyah' or 0 }

-Blake

Replies are listed 'Best First'.
Re: Re: Re: (crazyinsomniac) Re: Coding superstitions
by n3dst4 (Scribe) on Jan 09, 2002 at 04:27 UTC
    Well caught; the class was actually in Java, but I transliterated the example.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2016-07-26 10:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (234 votes). Check out past polls.