X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=examples%2Ffilter_example.pl;h=55f545242c8b1f967e2b9de392fd57c246e5ff5b;hb=5af8685bea60c00aae46266c726ddfb0132d7d12;hp=7704ca409aba959febb11ec37ad0f264277e5e4c;hpb=b2d8cef8551aa63c2718732e53392e7ebdd6c75f;p=perltidy.git diff --git a/examples/filter_example.pl b/examples/filter_example.pl old mode 100644 new mode 100755 index 7704ca4..55f5452 --- a/examples/filter_example.pl +++ b/examples/filter_example.pl @@ -26,13 +26,16 @@ use Perl::Tidy; # that the postfilter properly undoes the prefilter. my $arg_string = undef; -Perl::Tidy::perltidy( +my $err=Perl::Tidy::perltidy( argv => $arg_string, prefilter => sub { $_ = $_[0]; s/^\s*method\s+(\w.*)/sub METHOD_$1/gm; return $_ }, postfilter => sub { $_ = $_[0]; s/sub\s+METHOD_/method /gm; return $_ } ); +if ($err) { + die "Error calling perltidy\n"; +} __END__ # Try running on the following code (file filter_example.in):