It's me again, still won't work.  Here is the whole script:
Again, any help would be great.

Thanks.

 
 chdir "/u131/tmp" or die $!;

 opendir(HERE, '.');

 @AllFiles = readdir(HERE);

 foreach $Name (@AllFiles) {

   if (-f $Name) {next}

   if ((-d $Name) and ($Name =~ /^[A-Z]+$/)) {rmdir $Name}


   if ((-d $Name)) {print "$Name\n"}

   }                          

-----Original Message-----
From: Maxim Berlin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 9:22 AM
To: '[EMAIL PROTECTED]'
Subject: Re: rmdir


Hello Chris,

Tuesday, June 26, 2001, Porter, Chris <[EMAIL PROTECTED]> wrote:

PC> Hi, was hoping someone could help.
PC> I want to remove some directories:
PC> .Any help would be greatly appreciated.
PC> Basically, I want to remove all directories with Capital letters in this
PC> directory.  Make sense.
PC> Here is my script, looks like it's working but it's not removing all the
PC> directories
PC> opendir(HERE, '.');

PC>  @AllFiles = readdir(HERE);

PC>  foreach $Name (@AllFiles) {

PC>    if (-f $Name) {next}

PC>    if ((-d $Name) and ($Name =~ /^[A-Z]+$/)) {rmdir '$Name'}

change
 rmdir '$Name'
to
 rmdir "$Name"
or to
 rmdir $Name

' and " is very different in perl.


Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]

Reply via email to