use strict; use warnings; # eval{} is insufficient - we need string-extrapolation BEGIN { my $f="Data::Dumper"; eval "use $f"; }; my $g="a string"; print "Dumper", Dumper($g),"\n";