#!/usr/local/bin/perl
use CGI;
$query = new CGI;
print $query->header(-charset => "Windows-1251");
use CGI qw(param);
$n = param('name');
$n = $n."\n";
open (fi, "jack.txt");
@vals = ();
while ($record = ) {
push(@vals,$record);
}
close(fi);
push(@vals,"$n");
@so = sort(@vals);
open (fi,">jack.txt");
for ($i =0; $i <= $#so;$i++)
{print fi "$so[$i]";
}
close (fi);
#Gets a name from a form
#Reads in names from a file to an array
#adds name to the array
# Sorts the array
# Writes names back to the file