[Israel.pm] negative array indexing

Yaakov Belch lists at yaakovnet.com
Sun Feb 15 04:43:00 PST 2004

>@a=(5,6,7); $a[-5]=22;
>Is this one allowed ?
I just typed into the shell:
   perl -we '@a=(5,6,7); $a[-5]=22'
Perl answers your question:
  Modification of non-creatable array value attempted, subscript -5 at 
-e line 1.

Thus, we see that only positive array entries can be created.


More information about the Perl mailing list