Now you can just assign to $cwd to change directories, and when you localize it, it will restore the directory when the value goes out of scope.#!/opt/perl/bin/perl -w use strict; sub TIESCALAR {chomp (my $cwd = `pwd`); bless \$cwd => shift} sub FETCH {${$_[0]}} sub STORE {chdir $_[1] or die; ${$_[0]} = $_[1]} use vars qw /$cwd/; tie $cwd => 'main';
-- Abigail
In reply to Re: local scoped cwd
by Abigail
in thread local scoped cwd
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |