I think this is the model that SelectSaver uses. Yup. Similar code.package PreserveWD; use strict; use Cwd qw(cwd); sub new { my $class = shift; my $self = cwd; bless \$self, $class; } sub DESTROY { chdir ${+shift) or die "Cannot restore directory\n"; }
-- Randal L. Schwartz, Perl hacker
In reply to RE: Preserve working directory
by merlyn
in thread Preserve working directory
by tilly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |