Honestly I wouldn't have implemented it your way in order to have a higher degree of reusability and readability.
Yeah, I wrote it to be kind of compact - I want to hide it away in a pm and not worry about it anymore (hence all the the tests). My application has limited scope, definitely only 2D data (fiddling with CSV), and I'm probably going to hide it away in a class so that the implementation can be upgraded later if necessary, or maybe replaced with an existing module (hence this thread).
Though not many people know if it depends on an implementation detail.
Hm, well I found this thread by tye where it sounds like it's probably reliable, and a whole bunch of other threads where it's a suggested technique. I just tested on Perl 5.6 up to 5.28, it works fine on all of them.
And unfortunately I don't think it can be used to alias hashes (i.e. values) too.
It can :-) Also:
$ perl -wMstrict -MData::Dump -le 'my %h=("a".."j"); my $x=sub{\@_}->(@h{"c","e","g"}); $_=uc for @$x; dd \%h' { a => "b", c => "D", e => "F", g => "H", i => "j" }
In reply to Re^4: Selecting Ranges of 2-Dimensional Data
by haukex
in thread Selecting Ranges of 2-Dimensional Data
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |