It uses the magic attached to the ARGV filehandle which automatically iterates over all lines of all filenames in @ARGV.use Modern::Perl; my $sum_of_used; @ARGV = <C:/Users/user/Desktop/DOwork/filez/nabillingscript/09_14_2012 +/nas/*>; { no warnings qw/numeric uninitialized/; $sum_of_used += (split /\s+/)[2] while <ARGV>; } say $sum_of_used;
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial DeltronicsIn reply to Re^3: sumof - attempting to sum a column from each file
by CountZero
in thread sumof - attempting to sum a column from each file
by ricky5ive
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |