lex2001 has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I'm using strict; with a basic email program. I have some html code (in my main perl script) that prints out a form that a user fills out. I have also created a config file that creates an array called @fields. So for each element in @fields I want to print out:
<input type="text" name="$fields[0]" size="24">
and so ...
However when I use strict; I get the following error:
Global symbol "@fields" requires explicit package name at /Library/Web +Server/CGI-Executables/mailto/mailto.cgi line 106.
The error line corresponds to:
print<<HTML;
but it obviously has a problem with the my @fields reference.
How can I use strict; and also use a separate config file? I want the config file so that my scripts can be portable. Is it a bad idea to use config file? If not then how can I make them work under strict;
thanks in advance.
Edited 2001-11-11 by Ovid
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using strict and a config file
by snowcrash (Friar) on Nov 12, 2001 at 13:13 UTC | |
by tilly (Archbishop) on Nov 12, 2001 at 14:09 UTC | |
by lex2001 (Sexton) on Nov 12, 2001 at 13:56 UTC | |
by busunsl (Vicar) on Nov 12, 2001 at 14:00 UTC | |
by Amoe (Friar) on Nov 12, 2001 at 21:39 UTC | |
Re: using strict and a config file
by busunsl (Vicar) on Nov 12, 2001 at 13:14 UTC | |
by lex2001 (Sexton) on Nov 12, 2001 at 13:33 UTC | |
by busunsl (Vicar) on Nov 12, 2001 at 13:55 UTC | |
by tilly (Archbishop) on Nov 12, 2001 at 14:13 UTC | |
by busunsl (Vicar) on Nov 12, 2001 at 14:18 UTC | |
| |
by mce (Curate) on Nov 12, 2001 at 13:55 UTC | |
by tilly (Archbishop) on Nov 12, 2001 at 14:30 UTC | |
by guha (Priest) on Nov 12, 2001 at 16:12 UTC |