Re: [Boston.pm] delete($_[2]); doesn't

Bill Ricker via Boston-pm <[email protected]> Thu, 9 Jan 2020 13:20:25 -0500
Newsgroups gmane.comp.lang.perl.perl-mongers.boston
Message-ID <CAAbKA3Vgx=m+e7MfS1mgSknAxJJjjnfUvnVovyZr5k+PjXJ+7g@mail.gmail.com>
On Wed, January 8, 2020 7:57 pm, Randal L. Schwartz wrote:
> This is a relatively modern feature.  How old is your Perl?
On Thu, Jan 9, 2020 at 12:39 PM Greg London <email-2Ro/Dj86MvDSUeElwK9/[email protected]> replied:

> This is for a script at work
> And they run perl 5.8


So you need a really old book as your reference :-/
(I trust you have a dog-eared copy of the blue camel.)
If you haven't yet, you should bookmark
https://perldoc.perl.org/5.8.8/index-language.html (or 5.8.4 or whatever it
is) at work.

(Uri's advice from the Perldoc that it isn't even a good idea to delete
from an Array on a modern perl is well-taken also, but as Randal points
out, doesn't affect your legacy perl.)

So you'll need to code this another way.
Uri's suggested *splice*() was indeed available in 5.8.x -- but was
upgraded in 5.14. and later, so rely on the old documentation
<https://perldoc.perl.org/5.8.8//functions/splice.html>, as latest docs may
advise on corner-cases wrongly.

// Bill
consultant at The Perl Shop