Brady Jacksan wrote: > > Hi, Hello,
> I am writing a form that will list the name in the file namedata.dat > in alphabetical order and display in a web page. > #!/usr/bin/perl > use strict; > use CGI qw(:standard); > my @namedata; > whie (<namedata>){ ^^^^ Should be 'while'. Where did you open a file with the filehandle namedata? > @namedata = split (/\|/,$_); > if ($namedata[0] =~name_word){ > print"<b> Firstname:$namedata[1]",br()"lastname:$namedata[0]; > } > } > Why do I keep getting errors when I try to test my form? What errors are you getting? To sort the contents of namedata.dat you have to store the complete contents in an array (or use an external sort program.) open IN, 'namedata.dat' or die "Cannot open namedata.dat: $!"; chomp( my @namedata = sort <IN> ); close IN; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]