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

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 }


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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2016-10-28 15:20 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (385 votes). Check out past polls.