Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl my $in; if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } else { $in = <STDIN>; } $in =~ s/\+/ /g; $in =~ s/%(..)/pack("c",hex($1))/ge; my %movie = split (/=/, $in); open (DATA, "/home/export/users/cis14/cheu0576631/public_html/cgi-bin/ +MovieList.txt"); my @data = <DATA>; close (DATA); print <<END; Content-Type: text/html\n\n <html> <body bgcolor="#000000" text="#ffffff"> <center><h2>Results</h2></center><p> <center><hr size=1 width=50%></center> END for ($i = 0; $i <= $#data; $i++) { if ($data[$i] =~ /-- $movie{'title'} --/i) { print <<END; <center><b><font size="+1">$data[$i + 1]</font></b></center><br> $data[$i + 2]<br> END last; } elsif ($i == $#data) { print "<b><i>Sorry! I haven't reviewed that one yet!</i></b>"; } } print <<END; <center><hr size=1 width=50%></center> </body> </html> END
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Flat-File
by Zaxo (Archbishop) on Nov 22, 2003 at 06:04 UTC | |
|
Re: Flat-File
by l3nz (Friar) on Nov 22, 2003 at 07:22 UTC | |
|
Re: Flat-File
by CountZero (Bishop) on Nov 22, 2003 at 13:45 UTC |