Re: Trouble with variable scoping
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 31 Aug 2006 06:47:35 -0700
John Moon wrote:
When I run this, I get an error "Can't localize lexical variable". I
understand that it's because the variable is declared using "my"; what
I don't understand is why, or what I should declare the variable as,
since if I leave out "my" I get an error using "use strict".
Maybe you want..
Use vars qw(@excludedIPAddresses);
No, no you don't. For one, that's a syntax error, as there is no such
keyword 'Use'. For two, the vars pragma has been obsoleted by the our
keyword. And for three, there's no reason to make this a global
variable.
Paul Lalli
.
- References:
- RE: Trouble with variable scoping
- From: John Moon
- RE: Trouble with variable scoping
- Prev by Date: RE: Trouble with variable scoping
- Next by Date: Re: CORE DUMP by script !!
- Previous by thread: RE: Trouble with variable scoping
- Next by thread: File locking issue
- Index(es):
Relevant Pages
|