X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=examples%2Fbbtidy.pl;fp=examples%2Fbbtidy.pl;h=7353a81be8fafff0b9bc29249a902680443d3768;hb=b2d8cef8551aa63c2718732e53392e7ebdd6c75f;hp=0000000000000000000000000000000000000000;hpb=6db2d2d637f1770091b91e756590864baa1ad366;p=perltidy.git diff --git a/examples/bbtidy.pl b/examples/bbtidy.pl new file mode 100644 index 0000000..7353a81 --- /dev/null +++ b/examples/bbtidy.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -wn + +# This program was posted on the MacPerl mailing list by +# Charles Albrecht as one way to get perltidy to work as a filter +# under BBEdit. + +use Perl::Tidy; + +BEGIN { my $input_string = ""; my $output_string = ""; } + +$input_string .= $_; + +END { + Perl::Tidy::perltidy( + source => \$input_string, + destination => \$output_string + ); + + print "$output_string\n"; +} + +__END__ +