in reply to use, require, do or what?
I'm not recommending this approach, but if you really need to get it working, you can eval Library.pl's content. That's similar to do, but differs in that lexical variables in the enclosing scope are visible in the eval.
my $variable1; open my $lib, "<", "./Library.pl" or die $!; { local $/; eval <$lib>; } close $lib; print "$variable1\n";
|
---|