Ken, I had the same problem when I was doing the same problem. I came from CGI How-to from the Waite Group Press. The problem I had was not in the form.pl (Chapter 5.2) script. That is a very simplistic script. The problem I had was in the parseHtml.pl script. I typed it in as the book describes and no matter what it wouldn't work. So I copied from the CD the parseHtml.pl which I believe you did. The problem may be this: Originally this line worked when it read: # If the file opened, call the parser on it $retVal = &mainHtmlParser("",0) if htmlFile; Change it back. Check all you permissions to be sure they are executable and your form.pl and form_pl.htm are writable. Next try and trip up the parseHtml.pl. According to the script, it should fail if you have a <!-- <blah> >. In other words a tag within a tag. If it comes back with a failure then find out where it is failing. This line tells us nothing, because it is repeated several times. die "This is an invalid html file.\n"; To overcome this I changed my lines to: die "This is an invalid html file one.\n"; die "This is an invalid html file two.\n"; One or two tells me where in the script it is failing. One last item. I use a ISP who only allows the script to run as a .cgi. Try these. alan :) > Thanks Ron, > > I am still doing something wrong here because now I can't execute form.pl > > sub parseHtml > { > # Declare variables to hold the arguments > local($fileName) = @_; > > # Declare a variable to store the return value > local($retVal); > > open(htmlFile, $filename) or die "Unable to open $filename: $!\n"; > > > # If the file opened, call the parser on it > $retVal = &mainHtmlParser("",0); > > # Close the file > close(htmlFile); > > # Return the string parsed from the file > return $retVal; > > P.S. Don't refer to anyone the book "Perl 5 How TO" by Stephan Asbury, >Mike Glover, Ed Weiss, Jason Mathews, Selena Sol. It claims to have >internet support, it doesn't have diddley. > > Thank You > ken t. Thanks Alan, I'll play with your to die for lines and see if I can get it working. I went through one book with out any hitches but ran into problems right out of the box with this book and can't even get going till I get this solved so I really appreciate your help! P.S. I have "chmod" the form.pl, parsehtm.pl and even the f2_pl.htm and form_pl.htm as refered by Ron. My server allows .cgi and .pl extensions so I don't have a problem there. (i don't think). When I try to execute the form.pl from an html script it gets busy for a few seconds and the form.pl address appears in the address window, but the page is blank. It's supposed to return me the f2_pl.htm, but of course does not. Were you able to get support on the book you bought? |