On 08/31/2006 08:19 AM, Roman Daszczyszak wrote:
In my perl script, I have a "global" variable called
@excludedIPAddresses, [...]
my @excludedIPAddresses = qw# 192.168.0.142 192.168.3.118 #; #
[...]
local @excludedIPAddresses = @excludedIPAddresses;
[...]
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".
Declare it using 'our':
our @excludedIPAddresses;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>