@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.
In reply to Re: divide by '/'
by dws
in thread divide by '/'
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |