my $FP = 'D:\conv';
my $TP = 'D:\sgml_db';
my $cwd = `cd`; # Get current working directory
my ($from_dir, $to_dir) = ($cwd, $cwd);
# if your current working directory ($to_dir) doesn't have 'D:\conv' the below line doesn't change the value of $to_dir.
# So $to_dir equals to current directory and it already exists.
# So mkpath($to_dir) doesn't work.
$to_dir =~ s/^\Q$FP\E/$TP/;
mkpath($to_dir);
So ensure your $to_dir value must match the $FP value and you will be get the expected output.
Reputation Points: 55
Solved Threads: 24
Junior Poster in Training
Offline 93 posts
since Jun 2009