in reply to Can you limit the scope of require?
I don't understand your problem, so here's a WAG.
# require.one sub foo { print "one\n" } 1;
# require.two sub foo { print "two\n" } 1;
#!/usr/bin/perl # https://perlmonks.org/?node_id=1218946 use strict; use warnings; require './require.one'; foo(); { # lexical block local *foo; require './require.two'; foo(); } # end lexical block foo();
"local" is your friend :)
|
|---|