- or download this
use strict;
use warnings;
...
$hash{$line} = $text;
}
print $hash{$_} . "\n" for (sort keys %hash)
- or download this
perl pm1.pl < input.txt > output.txt
- or download this
use strict;
use warnings;
...
$array[$2] = 1 if ($_ =~ m/(.+)(\d+)$/)
}
print defined $_ ? $_ . "\n" : "\n" for @array[1..$#array];