File: README.md

package info (click to toggle)
libcwd-guard-perl 0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 104 kB
  • ctags: 5
  • sloc: perl: 30; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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](http://search.cpan.org/perldoc?File::chdir), [File::pushd](http://search.cpan.org/perldoc?File::pushd)

# LICENSE

Copyright (C) Masahiro Nagano

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