in reply to sorting and other problems in hash
Get the last 10 elements of the array:
No need to get the length of the array with $#array, or reverse the array, ...@array = qw /1 2 3 4 5 6 7 8 9 10 11 12 13 14 15/; print join ' ', @array[-10 .. -1];
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sorting and other problems in hash
by oko1 (Deacon) on Dec 31, 2008 at 15:34 UTC |