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

Refresh
Refresh
Source Files
Filename Size Changed
Cwd-Guard-0.04.tar.gz 0000009883 9.65 KB
perl-Cwd-Guard.spec 0000001653 1.61 KB
Latest Revision
Mark Stopka's avatar Mark Stopka (m4r3k) committed (revision 1)
Comments 0
openSUSE Build Service is sponsored by