]> git.donarmstrong.com Git - perltidy.git/blobdiff - examples/filter_example.pl
New upstream version 20180220
[perltidy.git] / examples / filter_example.pl
old mode 100644 (file)
new mode 100755 (executable)
index 7704ca4..55f5452
@@ -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):