CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
sorting and order



Jun 12, 2001, 2:16 AM

Post #1 of 2 (548 views)
sorting and order Can't Post

i have a script that takes a txt file and diplays it as a page with header and footer

the txt file is a list of discos in and around france...
what i would like to do is for the to come out in a sorted order.
i have added | in the field where i wanted it to be sorted by and |\n to finish record

is this possible or is it a bit far fetched

thanks once again

davidd sargent


Jun 12, 2001, 4:17 AM

Post #2 of 2 (546 views)
Re: sorting and order [In reply to] Can't Post


is this what you are looking for?


$discos = "groovydisco|discotech|discofever";

@yourchoices = split(/\|/, $discos);
@yourchoices = sort @yourchoices;

foreach $tech (@yourchoices) {
print "$tech\n";

I Hope this helps...

perl programmers don't die.. they just start writing a new script.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives