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