# The PerlTokenSearch package is an interface to perltidy which accepts a
# source filehandle and looks for selected variables.
#
-# It works by making a a callback object with a write_line() method to
+# It works by making a callback object with a write_line() method to
# receive tokenized lines from perltidy.
#
# Usage:
print "Testing File: $args{_source}\n";
# run perltidy, which will call $formatter's write_line() for each line
- perltidy(
+ my $err=perltidy(
'source' => $args{_source},
'formatter' => bless( \%args, __PACKAGE__ ), # callback object
'argv' => "-npro -se", # -npro : ignore .perltidyrc,
# -se : errors to STDOUT
);
+ if ($err) {
+ die "Error calling perltidy\n";
+ }
}
sub write_line {