]> git.donarmstrong.com Git - perltidy.git/blob - examples/bbtidy.pl
fix up debian janitor merge commit to match actual pieces which were comitted
[perltidy.git] / examples / bbtidy.pl
1 #!/usr/bin/perl -wn
2
3 # This program was posted on the MacPerl mailing list by 
4 # Charles Albrecht as one way to get perltidy to work as a filter
5 # under BBEdit.
6
7 use Perl::Tidy;
8
9 BEGIN { my $input_string = ""; my $output_string = ""; }
10
11 $input_string .= $_;
12
13 END {
14     my $err=Perl::Tidy::perltidy(
15         source      => \$input_string,
16         destination => \$output_string
17     );
18     if ($err){
19         die "Error calling perltidy\n";
20     }
21     print "$output_string\n";
22 }
23
24 __END__
25