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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
File Sorting

 



edesign
Deleted

Mar 13, 2000, 9:02 AM

Post #1 of 2 (588 views)
File Sorting Can't Post

Hello! I need some help with file sorting. On my site, I have a archive section that takes text files for each item, and then puts them on a .shtml page, although, I cannot get the script to put them in alphabetical order. How can I get the script to open the file, reap the first line of the file, and order them all by that? Let me know. Thanks!

-Daniel


Cure
User

Mar 13, 2000, 11:50 AM

Post #2 of 2 (588 views)
Re: File Sorting [In reply to] Can't Post

Hi

open(CURE, "database.txt") or die "coudlnt open file. $!";

map { print $_->[0] } sort { $a->[0] cmp $b->[0] }
map{ [$_ ] } <CURE>;

close(CURE);

Cure

 
 


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

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