http://qs321.pair.com?node_id=60625
Category: Text processing
Author/Contact Info drus3113@cs.com or just drus3113 on Compuserve, AOL, or AIM.
Description: This is the first script I have ever made, though it could use some improvements. This is about 2 months old out of my 5 month Perl career. Any improvements or suggestions will be, as usual, thankfully accepted.
 
#!/usr/bin/perl -wT
use CGI qw(:all);
use strict;

print header, start_html("Alphabetical sorter"), center(h2("Alphabetic
+al sorter"));


my $query = new CGI;
if ($query->param(1)) {
    foreach my $key (sort {lc(param($a)) cmp lc(param($b))} ($query->p
+aram)) {
        print "<STRONG>$key</STRONG> = ";
        my @values = $query->param($key);
        print join("",@values),"<BR>\n";
    }

}else{
    print start_form;
    print textfield({name=>$_,size=>'20'}),br for 1..5;
    print submit, end_form;
}