KMR
Main Page
Data Types List
Files
File List
File Members
shell
wc.map.pl
1
#!/usr/bin/perl
2
3
# wc.map.pl. Example for KMR shell command pipeline. It is a mapper
4
# for word count.
5
6
use strict;
7
8
my $counter;
9
10
while(<STDIN>) {
11
chomp $_;
12
my @w = split(" ", $_);
13
foreach my $wd (@w) {
14
print $wd, " 1\n";
15
}
16
}
Generated by
1.8.11