/
usr
/
share
/
doc
/
perl-Filter
/
examples
/
closure
/
/usr/share/doc/perl-Filter/examples/closure
mkdir
upload
Name
Size
Mode
Actions
Count.pm
471
0644
edit
dl
rm
Decompress.pm
626
0644
edit
dl
rm
Include.pm
617
0644
edit
dl
rm
Joe2Jim.pm
295
0644
edit
dl
rm
NewSubst.pm
673
0644
edit
dl
rm
Subst.pm
384
0644
edit
dl
rm
UUdecode.pm
1046
0644
edit
dl
rm
Edit:
/usr/share/doc/perl-Filter/examples/closure/Subst.pm
(384B)
package Subst ; use Filter::Util::Call ; use Carp ; use strict ; use warnings ; sub import { croak("usage: use Subst qw(from to)") unless @_ == 3 ; my ($self, $from, $to) = @_ ; filter_add( sub { my ($status) ; s/$from/$to/ if ($status = filter_read()) > 0 ; $status ; }) } 1 ;
Save
cmd:
run