Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: sorting inside specific

by svsingh (Priest)
on Sep 10, 2004 at 13:35 UTC ( #390056=note: print w/ replies, xml ) Need Help??

in reply to sorting inside specific

You probably just need to split your data into blocks. Once you do that, sort the values in each block.

use strict; use Data::Dumper; undef $/; # read all data my @sets = split('<sep>\s', <DATA>); # split by block foreach (@sets) { my @values = split /\s/; # get each value in block my @sorted = sort { $a<=>$b } @values; print Dumper(\@sorted); }

Comment on Re: sorting inside specific
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://390056]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2015-11-28 13:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (742 votes), past polls