I can use this to include the a.pl file:
require 'a.pl';
Or I can use this:
$fn = 'a.pl'; require $fn;
However, the subroutine will not work:
sub fn { return 'a.pl'; } require fn();
Is there any syntax to resolve this? I noticed that I can get around the problem through
sub fn { return 'a.pl'; } require eval("fn()");
... but it's not very pretty.
source share