Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- open my $in, '<', 'text2' or die;
- my $h = {};
- while (<$in>) {
- my @line = split;
- $h->{$line[0]} = $line[1];
- }
- close $in;
- my $sum;
- my $dummy;
- while (<>) {
- chomp;
- $sum = 0;
- ($dummy = $_) =~ s/./{$sum += $h->{$&}}/gee;
- next if $sum <= 3;
- print "$_ $sum\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement