Well, there are issues with your second script that others have pointed out, but why not just put the first one (which you say works) inside a loop that loops through each file?
#!/usr/bin/env perl
use strict;
use warnings;
use autodie;
@allfiles = <C:/Users/user/Desktop/DOwork/filez/nabillingscript/09_14_
+2012/nas/*>;
foreach $file (@allfiles) {
open (FILE ,"<", "Myfile");
###-reads each line from the file and splits it by multiple spaces
while($lines=<FILE>) {
@kbused = split(/\s+/,$lines);
push(@kilo, $kbused[2]);
}
####-takes the number from column2 and removes the KB from the end
foreach $aline (@kilo) {
$aline =~ s/\D//g;
push (@onlynums, $aline);
}
$sumof += $_ for @onlynums;
print "$sumof\n";
close FILE;
}