
swd - Perl pragma to change the current working directory

use swd;

The swd pragma changes the current working directory($ENV{PWD}) to the directory from which the called program is invoked; after callee returning the previous state of $ENV{PWD} is restored.
use swd; # in the callee
print "callee: $ENV{PWD}\n";
print $_,$/ for glob'*';
__END__
qx/callee/; # in the caller
print "caller: $ENV{PWD}\n";
print $_,$/ for glob'*';
__END__


Vidul Petrov, <vidul@cpan.org>