http://qs321.pair.com?node_id=964228


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

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 :)