Argument $ARGV[0] never existed in memory (If I did not pass anything argument to the script), so there is no address for it.
It might be worth noting that undef values actually are scalars (SV) which live at a certain address. Consider this (note the SV = NULL(0x0) at ...)
use strict; use warnings; use Devel::Peek; sub p1 { my $n1 = @_; print "1. Parameters to the sub p1 $n1\n"; print \$_,"\n" for @_; Dump $_ for @_; } p1 $ARGV[0], undef; __END__ 1. Parameters to the sub p1 2 SCALAR(0x604f80) SCALAR(0x604160) SV = PVLV(0x67eba0) at 0x604290 REFCNT = 3 FLAGS = (GMG,SMG) IV = 0 NV = 0 PV = 0 MAGIC = 0x62f2a0 MG_VIRTUAL = &PL_vtbl_defelem MG_TYPE = PERL_MAGIC_defelem(y) TYPE = y TARGOFF = 0 TARGLEN = 0 TARG = 0x604f80 SV = NULL(0x0) at 0x604f80 REFCNT = 2 FLAGS = () SV = NULL(0x0) at 0x604160 REFCNT = 2 FLAGS = ()
In reply to Re: Question: Is undef a valid argument?
by almut
in thread Question: Is undef a valid argument?
by jujiro_eb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |