develooper Front page | perl.beginners | Postings from April 2002

CGI question

Thread Next
From:
Joe Echavarria
Date:
April 1, 2002 07:12
Subject:
CGI question
Message ID:
20020401151227.34442.qmail@web10804.mail.yahoo.com
Hi there,



I receive this error when i try to execute the script.
Use of uninitialized value at ./links1.cgi line 20,
<STDIN> chunk 1.
Use of uninitialized value at ./links1.cgi line 25,
<LISTA> chunk 1.
Use of uninitialized value at ./links1.cgi line 25,
<LISTA> chunk 2.
Use of uninitialized value at ./links1.cgi line 25,
<LISTA> chunk 3.
Use of uninitialized value at ./links1.cgi line 25,
<LISTA> chunk 4.
Use of uninitialized value at ./links1.cgi line 25,
<LISTA> chunk 5.
Use of uninitialized value at ./links1.cgi line 25,
<LISTA> chunk 6.

## this is the script.
#!/usr/bin/perl -w
use CGI qw/:all/;
print "Content-type: text/html\n\n";
print "<title>- LISTA DE LINKS -</title>";
open(LISTA,"links") or die "Error ---- > : $!\n";
open(CATEGORIAS,"categorias") or die "Error ---- > :
$!\n";
print "<B>Lista de Categorias </B><BR><BR>";
print "<form name=\"miforma\" action=\"./links1.cgi\"
method=\"post\" >";
print "<select name=\"categorias\" size=\"1\">";
while ($file1 = <CATEGORIAS>) {
   ($no,$desc)=split(":",$file1);
   print "<option value=\"$no\">$no</option>";
}
close(CATEGORIAS);
print "</select><Input type=\"submit\"
value=\"GO\"></form>";
print "<table border=5 cellpadding=5><caption><B>LISTA
DE LINKS
</B></caption><tr><th>TEMA</th><th>LINK</th></tr>";
if (param())
  {
     $cate= param('categorias');
     print " The Param is ---> es $cate";
  };
while ($file = <LISTA>) {
   ($categoria,$link) = split(":",$file);
##this code is not working
   if ($categoria eq $cate) {
   print "<tr><td >$categoria</td>","
","<td>$link</td></tr>" }
}
print "</table>";



__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About