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
/
closure
/
Subst.pm
1
package Subst ;
2
3
use Filter::Util::Call ;
4
use Carp ;
5
6
use strict ;
7
use warnings ;
8
9
sub import
10
{
11
croak("usage: use Subst qw(from to)")
12
unless @_ == 3 ;
13
my ($self, $from, $to) = @_ ;
14
filter_add(
15
sub
16
{
17
my ($status) ;
18
s/$from/$to/
19
if ($status = filter_read()) > 0 ;
20
$status ;
21
})
22
}
23
24
1 ;