X-Git-Url: https://git.donarmstrong.com/?p=perltidy.git;a=blobdiff_plain;f=examples%2Ffilter_example.pl;h=55f545242c8b1f967e2b9de392fd57c246e5ff5b;hp=7704ca409aba959febb11ec37ad0f264277e5e4c;hb=caa9a6008de8bbc9dddfb772bff67005c099d6dd;hpb=b2d8cef8551aa63c2718732e53392e7ebdd6c75f diff --git a/examples/filter_example.pl b/examples/filter_example.pl index 7704ca4..55f5452 100644 --- 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):