PAR::Filter::Bleach - Bleach filter


PAR-Packer documentation Contained in the PAR-Packer distribution.

Index


Code Index:

NAME

Top

PAR::Filter::Bleach - Bleach filter

SYNOPSIS

Top

    PAR::Filter::Bleach->apply(\$code);	# transforms $code

DESCRIPTION

Top

This filter removes all the unsightly printable characters from your source file, using an algorithm similar to Damian Conway's Acme::Bleach.

SEE ALSO

Top

PAR::Filter

AUTHORS

Top

Audrey Tang <cpan@audreyt.org>

http://par.perl.org/ is the official PAR website. You can write to the mailing list at <par@perl.org>, or send an empty mail to <par-subscribe@perl.org> to participate in the discussion.

Please submit bug reports to <bug-par@rt.cpan.org>.

COPYRIGHT

Top


PAR-Packer documentation Contained in the PAR-Packer distribution.
package PAR::Filter::Bleach;
use 5.006;
use strict;
use warnings;
use base 'PAR::Filter';

sub apply {
    my $ref = $_[1];

    $$ref = unpack("b*", $$ref);
    $$ref =~ tr/01/ \t/;
    $$ref =~ s/(.{9})/$1\n/g;
	$$ref = q($_=<<'';y;\r\n;;d;$_=pack'b*',$_;$_=eval;$@&&die$@;$_)."\n$$ref\n\n";
}

1;