in reply to Re:Use of uninitialised value... but it is defined ?!
in thread Use of uninitialised value... but it is defined ?!
lexical variable $variable has not been created, so the global variable of that name is usedUm ,no: the BEGIN block sees the lexical var, not the package var:
$x = 'pkg'; my $x; BEGIN { $x = 'lex' } print "$::x $x\n"; #prints pkg lex
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Use of uninitialised value... but it is defined ?!
by BrowserUk (Patriarch) on Mar 02, 2016 at 08:09 UTC | |
by dave_the_m (Monsignor) on Mar 02, 2016 at 08:37 UTC | |
by BrowserUk (Patriarch) on Mar 02, 2016 at 09:31 UTC | |
by Eily (Monsignor) on Mar 02, 2016 at 08:28 UTC | |
by Discipulus (Canon) on Mar 02, 2016 at 08:33 UTC |