# Foo.pm
package Foo;
use Filter::Util::Call ();
1;
sub import {
Filter::Util::Call::filter_add( sub {
my $status;
if (($status = Filter::Util::Call::filter_read()) > 0) {
s#("[^"]+")#\U$1\E#g;
}
$status;
} );
} #import
####
# bar
use Foo;
print "Hello World",$/;
#require 'bar2'; # source is not filtered ;-(
{
local $/;
open my $handle,'<','bar2' or die $!;
$source = <$handle>;
}
#eval $source; # source is not filtered ;-(
eval 'use Foo;'.$source; # even with importing again, source is not filtered ;-(
##
##
# bar2
print "Just Another Perl Hacker",$/;