Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Common Perl Pitfalls

by JavaFan (Canon)
on Apr 09, 2012 at 23:28 UTC ( #964228=note: print w/ replies, xml ) Need Help??


in reply to Common Perl Pitfalls

The thing is, Perl treats the result of a false logical test as the empty string (in scalar context)
It's actually a dual (triple) var:
$ perl -MDevel::Peek -wE '$x = 1 < 0; Dump $x' SV = PVNV(0x97f45a8) at 0x9805ad0 REFCNT = 1 FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x9801438 ""\0 CUR = 0 LEN = 4


Comment on Re: Common Perl Pitfalls
Download Code
Replies are listed 'Best First'.
Re^2: Common Perl Pitfalls
by Joe_ (Beadle) on Apr 10, 2012 at 18:12 UTC

    I will have to RTFM on that one :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2015-07-08 06:43 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 (94 votes), past polls