Sunday, March 17, 2002, 10:41:01 AM, Mark Maunder wrote:

> You have two dollar signs before the 'name' variable in
> the loop. That probably works provided the value of the
> variable is not a number, but it may be causing the
> strangeness you're experiencing. Always 'use strict' in
> your scripts. You should be storing your params in a hash
> and doing something like this instead:

> my %stuff;
> foreach my $name (param())
> {
>     $stuff{$name} = param($name);
> }

> Try that instead, perhaps it will solve your problem.

Seconded. Emphatically.

Creating variables in your main namespace is Just A Bad Idea.

Here's a couple of really obvious reasons not to do it:
http:[EMAIL PROTECTED]/msg22156.html

and you almost always want to 'use strict'. There's no
excuse for not using it except laziness (okay, except for
the perl golf crowd, but none of them would ever write
production code without it). And it's false laziness at
that, because it's going to cause you more trouble in the
long run.

Here's a nice post by ovid on perlmonks about strict:
http://www.perlmonks.org/index.pl?node=%27use%20strict%27%20is%20not%20Perl

Honestly, using a hash is the best thing.

If you really really really want to import your parameters,
then look at the 'import_names' method in CGI.pm.

Also you should be using taint mode as well. Look at
perldoc perlsec, or
http://www.perldoc.com/perl5.6.1/pod/perlsec.html


-- 
Best Regards,
Daniel                   [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to