Jason wrote: > > I have a project to retrieve a keyword from a .DAT file in perl, and i have > now managed to do this but now I need to create a HTML page where a user can > input a keyword and it will then display the results. Now all this is OK > until I try to link the keyword put into the HTML to the perl script, all I > get is nothing....here is the HTML script and the Perl script <--Snip--> > or die "$0: cannot open file \"$filename\" for reading: $!\n" ; > > my (@record, @records) ; #Define arrays record and records > while (<DATAFILE>) { #Iterate through <DATAFILE>, > tr/\r\n//d ; # Delete everything in $_ except returns and >newlines > push @record, $_ ; # ADD $_ to @record > if (@record == 11) { #IF @record equals 11 do the following, but >@record is Empty > push @records, join ("\t", @record); # I think you are trying to: # Join @record to nothing and seperate them # with \t, then add the result to @records. > @record = () ; #Empty @record > } #End_IF > } #End_While > close (DATAFILE) ; > my $keyword = 'SOMEDATA'; # No interpolation > print "Content-type: text/html\n\n"; > print "<H3>RESULTS:</H3>"; > (print map {"<br>$_\n"} grep /\Q$keyword\E/, @records); #do nothing @records is >empty # Find all SOMEDATAs in @records # and see in they exist in "<br>$_\n" <--Snip--> Jason- A question to get you started. How is the perl script going to get the value selected in the HTML page? Read through the Comments I added and see if they make sense, they shouldn't. Try writing the script in comments then go back and replace the comment lines with lines of code. If you would like send me the comment file and I'll give you a hand. You might want to check out "Perl and CGI for the WWW" by Elizabeth Castro for a quick intro to how Perl and HTML can play nice. If you are really interested in getting into Perl checkout the Camel Book. -- Mark Murphy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]