in reply to Re: 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"?"
One more thing I've just noticed:
The perldelta fragment mentions for(scalar($#foo)) { ... }. But what does this even mean? Why would anybody do this? $#foo is already a scalar (the index of the last element of @foo), why would anybody call scalar on it, and why would anybody use it in a foreach?
If you want to enlarge or shrink the array via $#foo, you can do it simply by $#foo = 43;. This foreach nonsense is just obfuscation and I don't see why was it "corrected".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why doesn't this die with "Can't use an undefined value as an ARRAY reference"?"
by haukex (Archbishop) on Oct 19, 2017 at 16:01 UTC |