#
# where -l specifies the maximum comment line length.
#
-# You will be given an opportunity to accept or reject eacy proposed
+# You will be given an opportunity to accept or reject each proposed
# change.
#
# This file demonstrates using Perl::Tidy to walk through a perl file
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 (
}
sub ifyes {
- my $ans = queryu(@_);
my $count = 0;
ASK:
+ my $ans = queryu(@_);
if ( $ans =~ /^Y/ ) { return 1 }
elsif ( $ans =~ /^N/ ) { return 0 }
else {