> > > 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.
>

I was following it up until this, but may have missed the point, maybe because
I haven't run into a need to use package that way, or didn't realize its
usefulness.

Simple enough that a different value of $x in the second print is out of the
question due to 'my', I hope.

How many "things" can packages be?  Is this foo a file?

/g



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

Reply via email to