Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Comparison result capture???

by flounder99 (Friar)
on May 14, 2003 at 19:57 UTC ( [id://258232]=note: print w/replies, xml ) Need Help??


in reply to Comparison result capture???

You can always sort IPs like this
use strict; my @ips = ( "1.2.3.4", "1.2.3.5", "1.2.3.3", "2.2.3.4", "1.0.2.3"); @ips = map {$_->[1]} sort {$a->[0] cmp $b->[0]} map { [ join(".", map {sprintf "%03d", $_} split('\.', $_) ), $_ ] } @ips; print join "\n", @ips; __OUTPUT__ 1.0.2.3 1.2.3.3 1.2.3.4 1.2.3.5 2.2.3.4

--

flounder

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found