in reply to divide by '/'
@numbers = qw( 1/23 3/45 65/0 6/01 0/100 123/4568 ); @sorted = sort { (split('/', $a))[0] <=> (split('/', $b))[0] } @numbers; print "@numbers\n";
Very embarrassing update: That last line should indeed read print "@sorted\n"; Thanks to jynx for the /msg.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: divide by '/'
by jynx (Priest) on Apr 12, 2001 at 23:19 UTC | |
by dws (Chancellor) on Apr 13, 2001 at 00:47 UTC |