in reply to Sorting @lines

So just sort it ;)

my @lines = ('124.43.adsf.ca', '235.23.aer.ca', '100.34.asdm.ca'); # c +reate the unsorted array my @sorted = sort @lines; # create the sorted array for (@sorted) { print "$_\n"; } # display

This displays:
100.34.asdm.ca
124.43.adsf.ca
235.23.aer.ca

Replies are listed 'Best First'.
Re: Re: Sorting @lines
by kanabrian (Initiate) on Oct 10, 2002 at 20:19 UTC
    Emm... realized where my error lies. Thanks. Initially I tried what you said did not work. But I know why. i was reading each files from directory. Due to logic error, I did not obtain a sorted list. I was able to fix. I thought it was due to the "." in the numbers. Thanks.