unless ($fh) { die "cannot open '$file': $!\n" }
my $formatter = CommentFormatter->new($line_length);
- perltidy(
+ my $err=perltidy(
'formatter' => $formatter, # callback object
'source' => $fh,
'argv' => "-npro -se", # dont need .perltidyrc
# errors to STDOUT
);
+ if ($err) {
+ die "Error calling perltidy\n";
+ }
$fh->close();
}
my $line_of_tokens = shift;
my $line_type = $line_of_tokens->{_line_type};
## my $input_line_number = $line_of_tokens->{_line_number};
- my $input_line = $line_of_tokens->{_line_text}; # the orignal line
- my $rtoken_type = $line_of_tokens->{_rtoken_type}; # type of tokens
- my $rtokens = $line_of_tokens->{_rtokens}; # text of tokens
+ my $input_line = $line_of_tokens->{_line_text}; # the original line
+ my $rtoken_type = $line_of_tokens->{_rtoken_type}; # type of tokens
+ my $rtokens = $line_of_tokens->{_rtokens}; # text of tokens
# Just print non-code, non-comment lines
if (