Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use utf8;
- use open qw(:encoding(utf8) :std);
- use feature 'say';
- my $total = 0;
- foreach (glob "${ARGV[0]}/*.dat") {
- open my $in, '<', $_;
- while (<$in>) {
- $total += $_;
- }
- close $in;
- }
- say $total;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement