With the explicit approach, you can't conveniently swap the called function for another function unless you do that swap globally:
#use Cwd 'getcwd'; require Cwd; # use either the stock getcwd() *getcwd = \&Cwd::getcwd; print "Locally, with stock getcwd() aliased\n"; which_one(); # Or our fake getcwd(), where we always claim to run under tmp: *getcwd = sub { "/tmp" }; print "Locally, with stock getcwd() aliased to our fake getcwd()\n"; which_one();
In reply to Re: Exporter vs explicit '::"
by Corion
in thread Exporter vs explicit '::"
by fionbarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |