Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://390056]
help
Chatterbox?
[james28909]: ok i have a new question ;)
[james28909]: i am not sure how to ask google this either

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2017-04-29 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.