On Wed, 19 Aug 2009, Timothy S. Nelson wrote:
> ..but Perl is more magic than bash :). Seriously, I can see both
> sides of the argument, and I'm leaning towards the $*CWD = chdir idea (as an
> option if people want to use it), but I realise that a lot of people are
> leaning the other way. So I'll argue for it, but don't care if I lose :).
I want both.
I can have both. Or in fact all three:
$*CWD = "foo"; # exception -- $*CWD isn't writable
use Cwd :fake;
$*CWD = "foo"; # OK, faking it
use Cwd :chdir;
$*CWD = q</tmp>; # OK, same as {chdir "/tmp"}
I wonder if this is becoming the new Perl mantra "use lexically scoped
pragmata".
perl6 -MCwd=fake ... # legacy behaviour
-Martin