in reply to Re: dynamically expand @INC beyond BEGINin thread dynamically expand @INC beyond BEGIN
# 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; [download]
... And lo and behold, it has worked!