NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
de-aliasing? (Score:1)
Re:de-aliasing? (Score:2)
Bingo! I needed to delete select pairs of items from an import list, but I couldn't do this:
The array slice assignment gave me a "modification of read-only value" error, hence the @_ = @_; statement.
It all feels rather clumsy, but it works.
Re:de-aliasing? (Score:1)
splice(@_, $i, 2)(or probablysplice(@_, $i, 2, undef, undef), if you really need theseundefs)?Reply to This
Parent
Re:de-aliasing? (Score:2)
I can't do the first because while I'm doing that, I'm iterating over the array by index. By using splice, I alter where everything is in the array and the indices are off. As for the second, I just didn't think about that. The array slice is what occurred to me first.