File: chdir-example.pl

package info (click to toggle)
libfile-chdir-perl 0.1006-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 168 kB
  • sloc: perl: 480; makefile: 50
file content (21 lines) | stat: -rw-r--r-- 230 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
use File::chdir;

mkdir "foo";

$CWD = "foo"; # now in foo/

mkdir "bar";

{
    local $CWD = "bar";  # now in foo/bar/
}

# back to foo
rmdir "bar";

pop @CWD; # now in original directory

rmdir "foo";