Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

RE: Re: Sorting on Section Numbers

by chip (Curate)
on Jul 28, 2000 at 14:54 UTC ( [id://24823]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @sects= qw( 1 2 2.2 2.13 2.1.7 3.4a 10.1 10.10 10.1a 1a.2 );
    my %sects;
    ...
        $sects{$key} = $_;
    }
    print "@sects{sort keys %sects}\n";
    
  2. or download this
    my @sorted = map { join '.', unpack 'N*', $_ }
                 sort
                 map { pack 'N*', split /\./ }
                 @unsorted;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2024-04-16 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found