Mine
public text v1 · immutable#!/usr/bin/perl
our @lines=(<>); # Read from stdin or a file
for our $i ("@lines") { # Parse each line into words?
our @line = split(' ',$i);
for my $w (@line) {
$wordcount{$w}++;
}
}
for our $w (keys %wordcount) { # Read out the hash table nicely.
print "$wordcount{$w}\t$w\n";
}
print "There are $#lines lines\n";