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

Re: [MacPerl] syntax error



At 12:07 PM 11/29/00, Amitava Basu wrote:
>
>I am having a lot of problem trying to fix the program.

Besides the space before EOP, which is the source of your error (see 
msgs from Nandor & Kimball), and which you should fix at the other 
locations too (another EOP, and TEST), I noticed a typo that might be 
causing other difficulties:

>  &ReadParse(*regitration-data);  <--- check spelling of registration

[snip]

>  if (length($registration-data{"FirstName"})> 0 &&
>length($registration-data{"Last Name"})> 0)

Most likely, this would have been caught by using the strict pragma, 
i.e., add the line

use strict;

at the beginning of your script.

If you're not used to coding this way, you might come to hate the messages

    "... requires explicit package name"

    "Use of uninitialized value"

until you realize what a great service this is for writing reliable scripts.

Of course, when you're utilizing other people's libraries and modules 
(like cgi-lib.pl), you might discover that _they_ don't adhere to 
strict rules. Then you'll have to study the errors & warnings 
carefully, find & fix the ones that apply to your own code, and then 
turn off strict (and maybe -w) when you place your script in its 
"real" environment (assuming you want to deploy scripts that rely on 
libraries/modules with questionable features...). Incidentally, 
AFAIK, cgi-lib.pl is OK in this regard, but I haven't utilized it for 
a long time, since the advent of CGI.pm.

HTH

1;



- Bruce

__Bruce_Van_Allen___Santa_Cruz_CA__

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