in reply to local scoped cwd
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: local scoped cwd
by tilly (Archbishop) on Jun 27, 2001 at 12:09 UTC |