vaevictus has asked for the wisdom of the Perl Monks concerning the following question:
In perl 5.6.x, there has been a discussion about using delete(), (which was designed to remove key->value pairs from hashes), and having it remove values entirely from arrays in the same fashion, (not just undefing the value for that index, but removing that index entirely).
I understand that in perl 5.005_03, the interpreter will not allow you to use an array in that situation.'
My predicament is this: delete($array[$index]) is more readable than slice($array,$index,1), and more efficient too, I think. What should I do to maintain each of my goals: backward compatibility to 5.005x, readability, and performance?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: delete(), but for arrays
by demerphq (Chancellor) on May 16, 2002 at 19:09 UTC | |
Re: delete(), but for arrays
by vladb (Vicar) on May 16, 2002 at 18:55 UTC | |
Re: delete(), but for arrays
by kal (Hermit) on May 16, 2002 at 19:25 UTC |
Back to
Seekers of Perl Wisdom