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

[MacPerl] Re:



At 12.55 97/4/26, Johnny wrote:
># Undefined subroutine &main::parse_form_data called.

>#!/usr/local/bin/perl
>
>
>$ENV{QUERY_STRING} = "field1=yes&field2=no&field3=you%20look%20nice";
>$webmaster = "john\@frankenstein.com";
>&parse_form_data (*simple_form);
>
>print "Content-type: text/html", "\n\n";
>
>$user = $simple_form{'user'};
>
>if ($user) {
>
>print "Nice to meet you ", $simple_form{'user'}, ".", "\n";
>print "Please visit this Web server again!", "\n";
>} else {
>print "You did not enter an name.  Are you shy?", "\n";
>print "But , you are welcome to visit this Web server again!", "\n";
>}
>
>exit(0);

You need to go back and look at the example again.  Actually, I have the
book, so if you have a page number I can look at it.  But your problem is
that you need to define the soubroutine parse_form_data, just as the error
message tells you.  You should also add the -w switch to the shebang line:

#!/usr/local/bin/perl -w

sub parse_form_data {
        #subroutine stuff
}

You also need to define *simple_form, which is supposedly being passed to
the parse_form_data subroutine.  I suggest going back to the basics.  Get
the book "Learning Perl," and read the online documentation at
http://www.perl.com/.

Good luck,

#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch