Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: wise ones, your help is needed

by damian1301 (Curate)
on May 02, 2001 at 23:26 UTC ( #77472=note: print w/ replies, xml ) Need Help??


in reply to Re: wise ones, your help is needed
in thread wise ones, your help is needed

Why use negation when there is always the handy-dandy unless loop? This works as well.

$text = '' unless defined $text;
And it is much clearer to read (at least to me) :)

Tiptoeing up to a Perl hacker.
Dave AKA damian


Comment on Re: Re: wise ones, your help is needed
Download Code
Replies are listed 'Best First'.
Re: Re: Re: wise ones, your help is needed
by japhy (Canon) on May 02, 2001 at 23:33 UTC
    I didn't use "unless" there, since "if not" is the same length, and it didn't hinder comprehension. (Not to mention 'unless' becomes 'if not' at compile-time, anyway.)

    japhy -- Perl and Regex Hacker

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (15)
As of 2015-07-31 15:29 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 (279 votes), past polls