#! /usr/bin/perl use strict; use warnings; print scalar @ARGV, "\n"
outputs 0. By explicitly accessing the non-existent array element, perl extends the array and populates those new values with undefs, and that is what gets passed to your subroutine. This is a manifestation of autovivification.. As ikegami points out, this isn't autovivification, but it is returning an undef as you attempt to access the undefined array element.
In reply to Re: Question: Is undef a valid argument?
by kennethk
in thread Question: Is undef a valid argument?
by jujiro_eb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |