Gisle Askestad wrote:

> Hi everyone
> 
> I'm using the folllowing script for listing directory content
> as acktive links on a webpage:
> 
> #!/usr/bin/perl
> 
> opendir D, "../inn2001/";
> @a=grep !/^\./, readdir D;
> closedir D;
> print "Content-type:text/html\n\n";
> @b = reverse (@a);
> foreach(@b) {


REplace the above 2 lines with (unless you have a reason to reverse
the sort - and in that case add 'reverse' in front of 'sort'):

        foreach (sort @a) {


>    if ($_ eq "index.htm") {}
>    else { 
>       $link='upload/exi.pl?';
>       $target=' target="_blank"';
>       print "<li><a href=",$link,$_,"$target>",$_,"<br>\n";
>    }
> } 
> 
> I need to list the all the links in alphabetic order.
> Any ideas??


-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to