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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.