in reply to Re: Using map function to print few elements of list returned by sort function
in thread Using map function to print few elements of list returned by sort function
Sorry to bug you with a follow up question. Is there a way we can nest two for loops in one line. For eg :
for $k (sort keys %h) { print $_->[1] for splice [sort {$b->[0]<=>$a->[0]} @{$h{$k}}], 0, 4 }
could be written something like:
print $_->[1] for splice [sort {$b->[0]<=>$a->[0]} @{$h{$k}}], 0, 4 fo +r keys %h
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using map function to print few elements of list returned by sort function
by LanX (Saint) on May 25, 2014 at 23:02 UTC | |
by jaypal (Beadle) on May 26, 2014 at 00:28 UTC | |
by LanX (Saint) on May 26, 2014 at 11:24 UTC | |
by jaypal (Beadle) on May 26, 2014 at 15:16 UTC | |
by jaypal (Beadle) on May 25, 2014 at 23:33 UTC |