Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: defined defined -- Bug or "Feature"?

by dave_the_m (Monsignor)
on Dec 24, 2015 at 09:36 UTC ( #1151110=note: print w/replies, xml ) Need Help??


in reply to Re^2: defined defined -- Bug or "Feature"?
in thread defined defined -- Bug or "Feature"?

PL_sv_undef, PL_sv_no and PL_sv_yes are three distinct values with distinct properties. Only PL_sv_undef is undef.

Dave.

  • Comment on Re^3: defined defined -- Bug or "Feature"?

Replies are listed 'Best First'.
Re^4: defined defined -- Bug or "Feature"?
by Anonymous Monk on Dec 24, 2015 at 10:21 UTC
    indeed :)
    #!/usr/bin/perl -- use Devel::Peek qw/ Dump /; select STDERR; print "\n\$ARGV\n"; Dump( $ARGV ); print "\nundef\n"; Dump( undef ); print "\n!!0 PL_sv_no\n"; Dump( !!0 ); print "\ndefined undef\n"; Dump( defined undef ); print "\n!!1 PL_sv_yes\n"; Dump( !!1 ); print "\ndefined defined undef\n"; Dump( defined defined undef ); __END__
    
    $ARGV
    SV = NULL(0x0) at 0x99b90c
      REFCNT = 1
      FLAGS = ()
    
    undef
    SV = NULL(0x0) at 0x3f4cc0
      REFCNT = 2147482895
      FLAGS = (READONLY)
    
    !!0 PL_sv_no
    SV = PVNV(0x3f7f84) at 0x3f4968
      REFCNT = 2147483646
      FLAGS = (PADTMP,IOK,NOK,POK,READONLY,pIOK,pNOK,pPOK)
      IV = 0
      NV = 0
      PV = 0x3f405c ""\0
      CUR = 0
      LEN = 12
    
    defined undef
    SV = PVNV(0x3f7f84) at 0x3f4968
      REFCNT = 2147483646
      FLAGS = (PADTMP,IOK,NOK,POK,READONLY,pIOK,pNOK,pPOK)
      IV = 0
      NV = 0
      PV = 0x3f405c ""\0
      CUR = 0
      LEN = 12
    
    !!1 PL_sv_yes
    SV = PVNV(0x3f7f9c) at 0x3f4978
      REFCNT = 2147483643
      FLAGS = (PADTMP,IOK,NOK,POK,READONLY,pIOK,pNOK,pPOK)
      IV = 1
      NV = 1
      PV = 0x3f8e7c "1"\0
      CUR = 1
      LEN = 12
    
    defined defined undef
    SV = PVNV(0x3f7f9c) at 0x3f4978
      REFCNT = 2147483643
      FLAGS = (PADTMP,IOK,NOK,POK,READONLY,pIOK,pNOK,pPOK)
      IV = 1
      NV = 1
      PV = 0x3f8e7c "1"\0
      CUR = 1
      LEN = 12
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2020-01-27 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?