Hi,
I am writing a form that will allow the user to find a record by first and last name
and display the record in an HTML page.
#!/usr/bin/perl
use strict;
use CGI qw(:standard);
my @namedata;
whie (<namedata>){
@namedata = split (/\|/,$_);
if ($namedata[0] =~name_word){
print"<b> Firstname:$namedata[1]",br()"lastname:$namedata[0];
br(),"City:$namedata[2]</b>,br();}}
Given that the file namedata below:
Atara|Frieda|Courtland|AZ|216|794-3876Zissily|Jeb|Elfrieda|AZ|711|574-5587Brown|Rubin|Lochiel|AZ|703|511-3745Jarvis|Sue|Gleason|AZ|520|356-1210Jones|Omar|Harshawk|AZ|602|294-7034Mason|Jimbo|Gleason|AZ|520|378-4458Mason|Alice|Elfrieda|AZ|711|654-4458Winnet|Alex|Fairbank|AZ|908|632-3151Smith|Samuel|Sunnyside|AZ|314|457-7989Smith|David|Sierra
Vista|AZ|520|487-7989StRegis|Les|Courtland|AZ|216|723-6122Stark|Bonnie|Lochiel|AZ|703|535-5203what
am I doing wrong?
Secondly, using the same file namedata above, I would like to list the namedata file
in alphabetical order in a web page.
#!/usr/bin/perl
use strict;
use CGI qw(:standard);
my @name;
while (<namedata>){
@name = split (/\|/, $_);
if (name[0]=~ $search_word){sort [1](A-Z)};
print "lastname:$name[1]" br(), "firstname:$name[0]"}
thanks,
Brady
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!