Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
While working on Class::CGI, I found myself needing to use the following line of code:
@_ = @_;
I've documented why that's necessary. Can you guess why?
Twenty questions (Score:2)
Re:Twenty questions (Score:2)
Nope :)
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)
Re:de-aliasing? (Score:2)
It's because I'm subclassing another module which imports and I do and old trick:
This doesn't update caller so I have no worries about whether or not the superclass checks the calling package and gets it wrong. However, it requires that @_ be present. By copying that variable to a separate array, I'd essentially be doing this:
I didn't see any value in introducing a temporary variable.
Re:de-aliasing? (Score:1)
You can’t adjust your cursor(s) to account for the missing elements?
(Btw, I guessed that it was for de-aliasing before I read the comments saying so.)
Re:de-aliasing? (Score:1)
splice(@_, $i, 2)(or probablysplice(@_, $i, 2, undef, undef), if you really need theseundefs)?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.
Re:de-aliasing? (Score:2)
Re:de-aliasing? (Score:1)
Re:de-aliasing? (Score:1)
overloading (Score:2)
Now I'll go and read the other comments to see how wrong I am.