Temporarily change the current directory

Edit Package perl-Cwd-Guard
http://search.cpan.org/dist/Cwd-Guard/

Cwd::Guard can change the current directory (chdir) using a limited scope.

use Cwd::Guard qw/cwd_guard/;
use Cwd;

my $dir = getcwd;
MYBLOCK: {
my $guard = cwd_guard('/tmp/xxxxx') or die
"failed chdir: $Cwd::Guard::Error";
... # chdir to /tmp/xxxxx
}
... # back to $dir

Source Files
Filename Size Changed
Cwd-Guard-0.04.tar.gz 0000009883 9.65 KB
perl-Cwd-Guard.spec 0000001653 1.61 KB
Comments 0
No comments available
openSUSE Build Service is sponsored by