WC -Sx- Jones wrote:

> James Edward Gray II wrote:
> > 1.  You show a means of variable declaration that you say replaces my()
> > when in fact it's equivalent to our().
> >
> > 2.  Your use of local() is scary at best.  It looks like a step
> > backwards in Perl history to me.  local() is pretty misunderstood to
> > begin with and I don't think we, of all people, should be adding to the
> > problem.
>
> I guess I am think as a brick:
>
> #! /usr/bin/perl -T
>
> use strict;
> use warnings;
>
> my $outside = 5;

Okay, you have hit on something here.  Variables declared outside of any
subroutine are indeed global to the script as a whole.  They really do not do
much to protect the varaiable.  This is why it is a good idea to limit the
number of variables declared outside of subroutines to a bare minimum.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to