sub &*chdir
1 | language documentation Independent routines |
1.1 | (Independent routines) sub &*chdir |
Documentation for sub &*chdir
assembled from the following types:
language documentation Independent routines
From Independent routines
(Independent routines) sub &*chdir
Defined as:
PROCESS::<&chdir> = sub (IO() --> IO::Path)
Changes value of $*CWD
variable to the provided $path
and sets the process's current directory to the value of $path.absolute
. NOTE: that in most cases, you want to use chdir
routine instead.
Returns an IO::Path
representing the new $*CWD
on success. On failure, returns Failure
and leaves $*CWD
untouched. The $path
can be any object with an IO method that returns an IO::Path
object.
Note that unlike regular chdir
, there are no arguments to specify which file tests to perform.
('/tmp'); # change $*CWD and process's current directory to '/tmp'('/not-there'); # returns Failure
Note that the following construct is a mistake:
# WRONG! DO NOT DO THIS!my = ('/tmp');
Use the following, instead; or see indir
if you do not need to change process's current directory:
temp ;('/tmp');