Re: map HoAoA

2010-10-19 Thread brian d foy
In article , Brandon McCaig wrote: > On Tue, Oct 19, 2010 at 2:31 AM, brian d foy wrote: > > Actually, we call it the "range operator" in Learning Perl. It just > > happens to be in a more general section named "List Literals". Both > > "range operator" and '..' have entries in the indices of Le

Re: map HoAoA

2010-10-19 Thread Brandon McCaig
On Tue, Oct 19, 2010 at 2:31 AM, brian d foy wrote: > Actually, we call it the "range operator" in Learning Perl. It just > happens to be in a more general section named "List Literals". Both > "range operator" and '..' have entries in the indices of Learning Perl > and Programming Perl. Perhaps y

Re: map HoAoA

2010-10-18 Thread brian d foy
In article <20101018005850.ga2...@playground.mcclains.net>, Mike McClain wrote: > This threw me for a loop for a while since there is no comma in > map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ]->[1] } keys %HoAoA; > but I figured out that the range operator '

Re: map HoAoA

2010-10-17 Thread Mike McClain
? > > > > my @arrays = > > > > map > > > > { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } > > > > keys %HoAoA ; > > > > > > my @seconds = > > > > map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ]-&

Re: map HoAoA

2010-10-16 Thread Mike McClain
/ ] ], > >> ); > >> > >> # this gets refs to all arrays > >> my @arrays = > >> map > >> { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } > >> keys %HoAoA ; > > > >This is equivalent to: &g

Re: map HoAoA

2010-10-13 Thread C.DeRykus
ments? > > >     my @arrays = > > >         map > > >         { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } > > >         keys %HoAoA ; > > > This is equivalent to: > > map { @{$HoAoA{$_} } } keys(%HoAoA); > > > Which flattens all the arrays into one b

Re: map HoAoA

2010-10-13 Thread Mike McClain
# this only gets the second entry from the last array of each hash > > entry > > my @seconds = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ]->[1] } > > keys %HoAoA ; > > @{ $HoAoA{$_} } [ 0..$#{ $HoAo

Re: map HoAoA

2010-10-13 Thread Mike McClain
On Wed, Oct 13, 2010 at 08:33:57AM +0200, Shlomi Fish wrote: > On Wednesday 13 October 2010 06:39:03 Mike McClain wrote: > > Why do @arrays and @seconds not have the same number of elements? > > my @arrays = > > map > > { @{ $

Re: map HoAoA

2010-10-12 Thread John W. Krahn
my @arrays = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } keys %HoAoA ; This is equivalent to: {{{ map { @{$HoAoA{$_} } } keys(%HoAoA); }}} Which flattens all the arrays into one big list. No, it just returns all the elements of the values of %HoAoA which are ar

Re: map HoAoA

2010-10-12 Thread Shlomi Fish
c1 bc2 / ] > ], > > ); > > # this gets refs to all arrays > my @arrays = > > map > { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } > keys %HoAoA ; > This is equivalent to: {{{ map { @{$HoAoA{$_} } } keys(

Re: map HoAoA

2010-10-12 Thread John W. Krahn
b => [ [ qw / ba1 ba2 / ], [ qw / bb1 bb2 / ], [ qw / bc1 bc2 / ] ], ); # this gets refs to all arrays my @arrays = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } keys %HoAoA ; # this only gets the second entry from the last array of each hash entry my

map HoAoA

2010-10-12 Thread Mike McClain
a1 ba2 / ], [ qw / bb1 bb2 / ], [ qw / bc1 bc2 / ] ], ); # this gets refs to all arrays my @arrays = map { @{ $HoAoA{$_} } [ 0..$#{ $HoAoA{$_} } ] } keys %HoAoA ; # this only gets the second entry from the last array of each hash entry my @seconds = map { @{ $HoAoA{$_} } [