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