Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Stringifying undefs

by esskar (Deacon)
on Mar 02, 2004 at 00:49 UTC ( [id://333127]=note: print w/replies, xml ) Need Help??


in reply to Stringifying undefs

my $foo = undef; print "\$foo = " . ($foo || 0);

Replies are listed 'Best First'.
Re: Re: Stringifying undefs
by TimToady (Parson) on Mar 02, 2004 at 01:03 UTC
    Or, if you have warnings turned off:
    print "\$foo = " . ($foo + 0);
      use warnings; my $foo = undef; print "\$foo = " . (++$foo-1);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found