I would like to require a module version and print the version used to a logfile. But when I try to do it as shown, I get an error saying sub ok() is undefined. The sub ok() works fine if I don't quote and eval it.
use strict; use diagnostics;
my $var = '
use SANDY 1.5;
use SANDY qw(ok);
';
eval($var);
print $var;
ok();