我无法更改perl中的dir。如何在perl中更改目录?
#!/usr/bin/perl
use strict;
my $dir=`date +%d%b%Y`;
#the output of $dir is 13Feb2014 that directory is already inside "/mnt/Recordings/Inbound/Kinrep/"
my $path = "/mnt/Recordings/Inbound/Kinrep/$dir";
chdir($path) or die "Cant chdir to $path $!";
每当我执行我的计划我不能改变我得到以下错误的目录。
Cant chdir to /mnt/Recordings/Inbound/Kinrep/13Feb2014
No such file or directory at Ftp_transfer_197.pl line 17.
该目录是否存在?如果没有,'system“mkdir $ path”;'应该可以帮助你。 – DeVadder