in reply to Preserve working directory
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Preserve working directory
by Aristotle (Chancellor) on Dec 18, 2002 at 15:33 UTC |