in reply to Scope in use
The double nature of my is probably causing false expectations, but this works:
C:\Windows\system32>perl use warnings; use strict; my $lib; # compile time file scope (declaration) use lib $lib="XXX"; # compile time use scope (assignment) print $lib; # run time file scope (output) __END__ XXX C:\Windows\system32>
but if you want to totally confuse your colleague show him this working code ;-)
use warnings; use strict; my $lib; print $lib; # prints XXX use lib $lib="XXX"; __END__ XXX
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
*) additional to the effect already described in use has it's own scope?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Scope in use
by RonW (Parson) on Sep 06, 2017 at 19:31 UTC |