On Sat, Jun 04, 2005 at 10:52:20PM -0000, Sebastian wrote:
> Test case: perl -le 'sub a { print exists $_[0] } a(undef); a($f = undef);'
> Problem: Using exists() on @_ does not work as expected with undef

This sheds some light on the problem.  They definately contain different
structures.  Don't know if Devel::Peek simply can't read the former @_ magic
in element 0 or if there's simply nothing there.


1 ~$  perl -MDevel::Peek -le 'sub a { print Dump [EMAIL PROTECTED];  print 
scalar @_;  print e 
xists $_[0] ? "Yes" : "No" } a(undef); a($f = undef);'
SV = RV(0x813c18) at 0x801180
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x80e470
  SV = PVAV(0x8026ec) at 0x80e470
    REFCNT = 3
    FLAGS = ()
    IV = 0
    NV = 0
    ARRAY = 0x106020
    FILL = 0
    MAX = 3
    ARYLEN = 0x0
    FLAGS = (REAL)
    Elt No. 0

1
No
SV = RV(0x813c18) at 0x801180
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x80e470
  SV = PVAV(0x8026ec) at 0x80e470
    REFCNT = 3
    FLAGS = ()
    IV = 0
    NV = 0
    ARRAY = 0x106020
    FILL = 0
    MAX = 3
    ARYLEN = 0x0
    FLAGS = (REAL)
    Elt No. 0
    SV = NULL(0x0) at 0x80e488
      REFCNT = 2
      FLAGS = ()

1
Yes


-- 
Michael G Schwern     [EMAIL PROTECTED]     http://www.pobox.com/~schwern
Just call me 'Moron Sugar'.
        http://www.somethingpositive.net/sp05182002.shtml

Reply via email to