testcall1.pl: #!/usr/bin/perl use strict; require "testcall2.pl"; func1 (); testcall2.pl: #!/usr/bin/perl use strict; my ($sep, $z); sub func2 { print "func2: \$sep == $sep\n"; eval '$z = sub { print "sep == ($sep)\n"; }'; &{$z}(); } sub func1 { $sep = "AB"; func2(); }