projects
/
pkg-perl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add the following packages libalgorithm-diff-perl libspiffy-perl libtext-diff-perl...
[pkg-perl]
/
deb-src
/
libfilter-perl
/
libfilter-perl-1.34
/
examples
/
method
/
Count.pm
1
package Count ;
2
3
use Filter::Util::Call ;
4
5
use strict ;
6
use warnings ;
7
8
sub filter
9
{
10
my ($self) = @_ ;
11
my ($status) ;
12
13
if (($status = filter_read()) > 0 ) {
14
s/Joe/Jim/g ;
15
++ $$self ;
16
}
17
elsif ($$self >= 0) { # EOF
18
$_ = "print q[Made ${$self} substitutions\n] ;" ;
19
$status = 1 ;
20
$$self = -1 ;
21
}
22
23
$status ;
24
}
25
26
sub import
27
{
28
my ($self) = @_ ;
29
my ($count) = 0 ;
30
filter_add(\$count) ;
31
}
32
33
1 ;
34