in reply to Re^2: Why doesn't this die with "Can't use an undefined value as an ARRAY reference"?"
in thread Why doesn't this die with "Can't use an undefined value as an ARRAY reference"?"
Indeed, there does seem to be some apparent inconsistency there. The only thing I see about your examples that might be considered "consistent" is that those functions that take a scalar argument are the ones throwing an error - although I haven't yet expanded my list to more functions to see if this holds true elsewhere.
$ perl -le 'printf "%10s %s\n",$_,prototype("CORE::$_")//"undef" for qw/pop shift map grep chomp lc localtime cos/' pop ;\@ shift ;\@ map undef grep undef chomp undef lc _ localtime ;$ cos _
As for subroutine arguments, the elements of @_ being aliases to the actual parameters is documented and useful, but also one of those things that bites many people.
In any case, this remains an interesting issue, thanks for continuing the investigation.
|
|---|