in reply to Re^3: Selecting Ranges of 2-Dimensional Data
in thread Selecting Ranges of 2-Dimensional Data
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" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Selecting Ranges of 2-Dimensional Data
by LanX (Saint) on Oct 28, 2018 at 10:17 UTC | |
by haukex (Archbishop) on Oct 28, 2018 at 10:58 UTC | |
by LanX (Saint) on Oct 28, 2018 at 11:53 UTC | |
by haukex (Archbishop) on Oct 28, 2018 at 16:16 UTC | |
by haukex (Archbishop) on Oct 28, 2018 at 21:52 UTC |