# Here's a variable... my $lib; # Make sure it gets defined at compile-time... BEGIN { $lib = '/foo' } # Use the variable in a "use" line... use lib $lib; # Check that it worked... use Data::Dumper; print Dumper \@INC;
... And lo and behold, it has worked!
In reply to Re^3: dynamically expand @INC beyond BEGIN
by tobyink
in thread dynamically expand @INC beyond BEGIN
by somekindafreak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |