> cat - >1.pl 1 > > cat - >2.pl 2 > > cat - >3.pl 3 > > perl foo.pl ?.pl 1.pl 1 Total value for the 1.pl : 1 2.pl 2 Total value for the 2.pl : 2 3.pl 3 Total value for the 3.pl : 3 Total value accumulated from all the files is:6> #### foreach my $file (@ARGV) { open(FILE, "$file"); my $sum = 0; while () { chomp(); $sum+=$_; print "$file $_\n"; $total+=$sum; } print "Total value for the $file : $sum\n"; close( FILE ); }