From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > > It loses
> > > scope in subroutines.
> >
> > Wrong.
> >
> > If you declare a variable with my() its scope will be from the
> > declaration to the end of the enclosing block. Which for variables
> > declared outside any {} block or eval"" means ... to the end of the
> > file.
> >
>
> Wrong.
>
> You forgot about 'package'.
What do you mean:
#!perl -w
my $x = 'Ahoj';
print "$x\n";
package foo;
print "$x\n";
__END__
I believe packages are completely irrelevant to lexical (declared
with my()) variables.
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]