package Filter::ObfuMethods; use Exporter::Tidy default => [ 'filter' ]; use Crypt::Rot13; use vars '%methods'; sub filter { my $code = pop; my(@calls) = $code =~ m{ \$? \w+ \s* -> \s* (\w+) }gx; @methods{map crypt_method($_), @calls} = @calls; $code =~ s{ ( \$? \w+ \s* -> \s* ) $methods{$_} } ($1\${\\\$Filter::ObfuMethods::methods{"$_"}})gx for keys %methods; return $code; } sub crypt_method { my $c = Crypt::Rot13->new; $c->charge(shift); return $c->rot13(6); } q[the end];