| Next | Tricks of the Wizards | 82 |
Here's a skeleton usage:
package Rot13 ;
use Filter::Util::Call ;
sub import
{
my($type, @arguments) = @_ ;
my $result = "";
filter_add(
sub
{
my $status = filter_read() ;
if ($status >= 0) {
tr/A-Za-z/N-ZA-Mn-za-m/;
}
return $status;
} )
}
1 ;
A filtering module should provide an import which calls filter_add
filter_add sets up the filter, which calls filter_read
filter_read places a line of code into $_
The filter modifies $_ and returns
| Next | ![]() |
Copyright © 2003 M. J. Dominus |