Jan Dubois <[EMAIL PROTECTED]> writes:
> This isn't the case. All subroutines defined *after* the lexical variable
> can access and modify it, if it is declared at file scope. Only lexicals
> defined in inner scopes are inaccessible from outer scopes:
>
> my $a;
> sub myfun {
> my $b;
> # $a and $b are *both* accessible here
> }
> # only $a is accessible now
Jan, this is leading me into some questions on style. Let's take the
following for example from build 522:
d:/Perl/bin/ppm.pl
The following lexical variable has *file scope*:
my %options = PPM::GetPPMOptions();
Then several variables are made *global*:
use vars qw ($location $Ignorecase $clean
$confirm $force_install $root $build_dir $more
$trace $tracefile $verbose);
and set with *typeglob* notation:
*Ignorecase = \$options{'IGNORECASE'};
Question #1: What is the point of using a typeglob here?
And from:
What's New in Perl 5.6.0?
http://www.perl.com/pub/2000/04/whatsnew.html
| `our' Variables
|
| Whereas `my' declares lexical variables, `our' declares global
| variables - it's a cleaner and hopefully more intuitive
| replacement for `use vars'.
Question #2: Is `our' merely syntactic sugar, or does it change the
behavior of global variables in some way? Does it behave differently
at compile time than `use vars'?
--David
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]