in reply to Exporter vs explicit '::"

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();

Replies are listed 'Best First'.
Re^2: Exporter vs explicit '::"
by fionbarr (Friar) on Jan 05, 2015 at 17:43 UTC
    thanks for your response