[EMAIL PROTECTED] wrote:

> Hi everyone.
> 
> 
> this loop
> *************** start code ***************
>   while($lstgd =~ m/$strt\/.+/){
>     if($verb>3){ &rep("\n\n check b: \$lstgd: $lstgd \t\$verb: 
> $verb\t\$strt: $strt",$verb); }
>     if($lstgd =~ m/(.*)\/[^\/]+$/){
>       my $rmv=`rmdir "$lstgd"`;
>       if($rmv eq ''){
>         if($verb>3){ &rep("\n\n$lstgd -> $1 -> $rmv\n\n",$verb); }
>         $lstgd=$1;
>       }
>     }
>   }
> *************** end code ***************
> is giving an invalid switch when $verb is less than 2 or greater than 3. 
> If i comment the line out for checkb, i also get the switch error. If 
> $verb is 2 or 3, there is no switch error
> 
>  check b: $lstgd: Z:/dssmoke/HFmvu      $verb: 4        $strt: Z:/dssmoke
> Invalid switch - "dssmoke".
> 
> 
> Z:/dssmoke/HFmvu -> Z:/dssmoke ->
> 
> is from the command line.
> 
> it's at the end of the while  loop
> 
> the point is to remove everything AFTER z:/dssmoke which is the starting 
> directory (saved in $strt).

If your intent is to remove all directories below Z:/dssmoke, then
I'd do a File::Find starting at the base dir and do a File::Path::rmtree
on any directories found in that dir (unless you also want the files
in thereremoved also).

> this is part of a function to test for the longest path one can have.
> 
> $strt can also be a SMB or UNC directory (local or absolute in SMB)
> 
> $lstgd is the last good path. 
> 
> I am not sure what is causing the invalid switch or  why it can be removed 
> by calling the script with different parameters.
> 
> Any suggestions on isolating this or explanation as to what is happening 
> would be greatly appreciated.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to