--On Mittwoch, 25. Juli 2001 09:27 -0800 Michael Fowler 
<[EMAIL PROTECTED]> wrote:

Thanks for the hint to File::Path;
Just one more question to make sure:

>> foreach $file (@files) {
>>      
>> ###  $destfile will be the copied file in subdir admin, $file the
>> ###  original
>> file in $origdir or one of its subdirectories
>>
>>      $file =~ m/($origdir)(.*\/)(.*)$/;
>>      $file =~ /($origdir)(.*?)(^\S+\.html)/;
>>      $destfile = "$targetdir$2$3"; #

>
>         mkpath(dirname($destfile));

Assume $targetdir holds "/home/somedir" and $2 holds 
"/anotherdir/yetanotherdir/";
So, to check if the dir /home/somedir/anotherdir/yetanotherdir exists, I 
would use:

chop($2); # remove final trailing slash
$subdir = "$admindir$2";
unless (-e "$subdir") {
        mkpath($subdir);
        }


Thanks again,

Birgit Kellner

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to