in reply to Modification of non-creatable array value attempted, subscript -1 error
You are attempting to use an invalid index for an array - Indices normally start at 0, and you are attempting -1.>perl -e "$x[-1]=0" Modification of non-creatable array value attempted, subscript -1 at - +e line 1.
If you show us the line where it fails, and how the subscript is calculated, it would help.
If you are on a 32-bit machine, and you are using the record number as a subscript, you may be over-running the count into the sign bit.
What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
-Larry Wall, 1992
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Modification of non-creatable array value attempted, subscript -1 error
by Anonymous Monk on Feb 21, 2014 at 00:12 UTC | |
by ww (Archbishop) on Feb 21, 2014 at 00:59 UTC | |
by Anonymous Monk on Feb 21, 2014 at 00:58 UTC |