hi all,
i am searching from a tab delimited text file and it is returning
the line with tabs which contains the search string into an array named
@found_array, now i want to display it on an html page in a predefined
format and for that i have to split it with tab as the delimiting
character. any idea for doing this as i have tried split function but i
think it doesnt work on arrays. any help is appreciated. Thanks in advance
the code is as follows
#!/usr/bin/perl -w
use CGI;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
$query = new CGI;
print "Content-type: text/html\r\n\r\n";
print $query->start_html(-title=> "new",
-bgcolor=>'#DFD2B3',
);
$keyword=$query->param('s1');
chomp($keyword);
$keyword =~ s/([~;<>\*\|`&\$!#\(\)\[\]\{\}:'"\.\/])//g;
open (IN, "< pdata") or die ("Cannot open database!");
@found_array = ();
while ($parray=<IN>)
{
@found_array = (@found_array,grep (/$keyword/i , $parray));
}
print "<font size=4 color=blue><b>You Queried for $keyword</b></font>\n";
print @found_array;
*****************************************
Shalabh Bhatnagar
Senior Research Fellow
Information Superhighway Centre (ISC)
Indian Institute of Technology
Roorkee
Uttaranchal - 247 667
India
Life is difficult, it is not supposed to be easy !
*****************************************
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>