perl-5.38.0
chdir EXPR
chdir FILEHANDLE
chdir DIRHANDLE
chdir

Changes the working directory to EXPR, if possible. If EXPR is omitted, changes to the directory specified by $ENV{HOME}, if set; if not, changes to the directory specified by $ENV{LOGDIR}. (Under VMS, the variable $ENV{'SYS$LOGIN'} is also checked, and used if it is set.) If neither is set, chdir does nothing and fails. It returns true on success, false otherwise. See the example under die.

(可能であれば、) カレントディレクトリを EXPR に移します。 EXPR を指定しないと、$ENV{HOME} が設定されていれば、そのディレクトリに 移ります; そうでなく、$ENV{LOGDIR}が設定されていれば、そのディレクトリに 移ります。 (VMS では $ENV{'SYS$LOGIN'} もチェックされ、もしセットされていれば 使われます。) どちらも設定されていなければ、chdir は何もせずに失敗します。 成功時には真を返し、そうでなければ偽を返します。 die の項の例を参照してください。

On systems that support fchdir(2), you may pass a filehandle or directory handle as the argument. On systems that don't support fchdir(2), passing handles raises an exception.

fchdir(2) に対応しているシステムでは、ファイルハンドルや ディレクトリハンドルを引数として渡せます。 fchdir(2) に対応していないシステムでは、ハンドルを渡すと例外が発生します。