From bbb87963f6274ae6a699d78960946d956a26e007 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 1 May 2020 06:22:31 -0700 Subject: [PATCH] convert print to use object call --- lib/Perl/Tidy/Debugger.pm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 38d431fa..74ec6123 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -33,8 +33,8 @@ sub really_open_debug_file { } $self->{_debug_file_opened} = 1; $self->{_fh} = $fh; - print $fh - "Use -dump-token-types (-dtt) to get a list of token type codes\n"; + $fh->print( + "Use -dump-token-types (-dtt) to get a list of token type codes\n"); return; } @@ -68,7 +68,6 @@ sub write_debug_entry { my $input_line_number = $line_of_tokens->{_line_number}; my $line_type = $line_of_tokens->{_line_type}; - ##my $rtoken_array = $line_of_tokens->{_token_array}; my ( $j, $num ); @@ -76,9 +75,6 @@ sub write_debug_entry { my $reconstructed_original = "$input_line_number: "; my $block_str = "$input_line_number: "; - #$token_str .= "$line_type: "; - #$reconstructed_original .= "$line_type: "; - my $pattern = ""; my @next_char = ( '"', '"' ); my $i_next = 0; @@ -104,7 +100,7 @@ sub write_debug_entry { # This can only happen if a programming error has been made # because all valid tokens are non-blank if ( $type_str eq ' ' ) { - print $fh "BLANK TOKEN on the next line\n"; + $fh->print("BLANK TOKEN on the next line\n"); $type_str = $next_char[$i_next]; $i_next = 1 - $i_next; } @@ -116,12 +112,11 @@ sub write_debug_entry { } # Write what you want here ... - # print $fh "$input_line\n"; - # print $fh "$pattern\n"; - print $fh "$reconstructed_original\n"; - print $fh "$token_str\n"; + # $fh->print "$input_line\n"; + # $fh->print "$pattern\n"; + $fh->print("$reconstructed_original\n"); + $fh->print("$token_str\n"); - #print $fh "$block_str\n"; return; } 1; -- 2.39.5