[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] parserhtm.pl



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.




===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org