On Mon, 4 Jun 2001, Luinrandir Hernson <[EMAIL PROTECTED]> wrote,
> what does:
> global symbol requires explicit package name
> mean?
>
> blast! the
> use strict;
> is causing that problem but i don't know how to do what it wants
No! It doesn't cause the problem. It *tells* you what causes the
problem. Don't panic. The error also tells you what global symbol
that requires explicit package name and the line number. The only
thing you need to do is declaring the variable in question with my()
operator.
my $what_is_the_variable_name_anyway;
Each variable must have explicit scope. All variables are global by
default, but you can make it lexically scope by declaring using my().
Please read the docs,
perldoc -f my
perldoc perlsub
When you use strict however, you have to explicitly specify whether
a variable is,
* in global scope by using a package name,
$main::variable_name = 'some value';
use vars qw($variable_name); # another way to declare global variable
* or in lexical scope by using my() operator as above,
my $variable_name;
hth
s.a.n
--
Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com