Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: When warnings get in the way

by davidrw (Prior)
on Apr 22, 2005 at 17:15 UTC ( [id://450499]=note: print w/replies, xml ) Need Help??


in reply to Re: When warnings get in the way
in thread When warnings get in the way

That (and there was a similar suggestion above as well) doesn't help his problem.
my $foo = ' '; # or my $foo = ''; $foo = getFoo(); if ( $foo eq "true" ){ ... } # this will warn if $foo is undef $foo = $dbh->selectrow_array("select x from blah limit 1"); if ( $foo eq "true" ){ ... } # this will warn if $foo is undef
In these cases, the original default value doesn't matter because it's overwritten later by a 'third party' (some sub or dbh call), and the hint to the Maintainer doesn't help cause it's something else (e.g. some db value) that's being stored.

Replies are listed 'Best First'.
Re^3: When warnings get in the way
by derby (Abbot) on Apr 22, 2005 at 17:22 UTC

    $foo = getFoo() || "";

    I really need to start paying attention.
    -derby

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2025-06-24 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.