in reply to removing reversed elements
You have an array of pairs of values and you only want to retain those where the second value of each pair is greater than (or equal to?) the first:
@v = ([100, 200],[200, 300],[200, 100]);; @r = grep{ $_->[0] < $_->[1] } @v;; pp @r;; ([100, 200], [200, 300])
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: removing reversed elements
by ramdat (Initiate) on Feb 02, 2011 at 09:20 UTC | |
by BrowserUk (Patriarch) on Feb 02, 2011 at 09:56 UTC | |
by wind (Priest) on Feb 02, 2011 at 18:46 UTC | |
by ramdat (Initiate) on Feb 02, 2011 at 10:12 UTC | |
by Anonymous Monk on Feb 02, 2011 at 12:07 UTC | |
by raybies (Chaplain) on Feb 02, 2011 at 14:11 UTC | |
|
Re^2: removing reversed elements
by bart (Canon) on Feb 02, 2011 at 12:40 UTC | |
by Anonymous Monk on Feb 02, 2011 at 13:16 UTC |