that defined $_[1] is necessary becuase local seems to undef the variable at some point (otherwise resulting in a chdir to $HOME).use Cwd; sub TIESCALAR {bless {} => shift} sub FETCH {cwd} sub STORE {defined $_[1] and (chdir $_[1] or die $!)} our $cwd; tie $cwd => __PACKAGE__;
In reply to Re: local scoped cwd
by Anonymous Monk
in thread local scoped cwd
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |