Masahiro Nagano > Cwd-Guard-0.01 > Cwd::Guard

Download:
Cwd-Guard-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.01   Source   Latest Release: Cwd-Guard-0.04

NAME ^

Cwd::Guard - Temporary changing working directory (chdir)

SYNOPSIS ^

  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

DESCRIPTION ^

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

FUNCTIONS ^

cwd_guard($dir);

chdir to $dir and returns Cwd::Guard object. return to current working directory, if this object destroyed. if failed to chdir, cwd_guard return undefined value. You can get error messages with $Gwd::Guard::Error.

AUTHOR ^

Masahiro Nagano <kazeburo {at} gmail.com>

SEE ALSO ^

File::chdir, File::pushd

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: