not sure if you meant except those that match...in that case, replace the if
with unless.

-Tom Kinzer

-----Original Message-----
From: danield [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 10:15 PM
To: perl_beginer
Subject: How to count the size of files in a directory


Hello all,

I do have a beautiful script, that counts a size of specified files
("ABAA.txt", "ABAC.txt") in a directory test. I have got this script
from discussion board.

Here is the script:

my $dir='c:\\test';
my @files2check = ("ABAA.txt", "ABAC.txt");

my $totalSize= 0;
foreach (@files2check) {
   $totalSize += (-s "$dir\\$_") if /^AB/;
}

print $totalSize;

I would like to modify it that it will count the size of all files in the
directory, EXCEPT those in list or so it will count the size of files that
match first 2 characters "AB" (sort of AB*)
Can anybody advice?

Thank you for your time.

danield


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to