X-Git-Url: https://git.donarmstrong.com/?p=perltidy.git;a=blobdiff_plain;f=lib%2FPerl%2FTidy%2FLineSink.pm;fp=lib%2FPerl%2FTidy%2FLineSink.pm;h=6516a9877e3c56d80c213f70bc40e59ac8d719f4;hp=ae0bfd20133dccdb443cace95b8f34a894c20b20;hb=effbe8e558790d5f5e4eb49a10b2ed020b0eaaee;hpb=c514d57dc8088e1f4d3f51857b1155c20085c296 diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index ae0bfd2..6516a98 100644 --- a/lib/Perl/Tidy/LineSink.pm +++ b/lib/Perl/Tidy/LineSink.pm @@ -8,7 +8,7 @@ package Perl::Tidy::LineSink; use strict; use warnings; -our $VERSION = '20220613'; +our $VERSION = '20230309'; sub AUTOLOAD { @@ -41,46 +41,24 @@ sub new { my ( $class, @args ) = @_; my %defaults = ( - output_file => undef, - line_separator => undef, - rOpts => undef, - rpending_logfile_message => undef, - is_encoded_data => undef, + output_file => undef, + line_separator => undef, + is_encoded_data => undef, ); my %args = ( %defaults, @args ); - my $output_file = $args{output_file}; - my $line_separator = $args{line_separator}; - my $rOpts = $args{rOpts}; - my $rpending_logfile_message = $args{rpending_logfile_message}; - my $is_encoded_data = $args{is_encoded_data}; + my $output_file = $args{output_file}; + my $line_separator = $args{line_separator}; + my $is_encoded_data = $args{is_encoded_data}; my $fh = undef; my $output_file_open = 0; - if ( $rOpts->{'format'} eq 'tidy' ) { - ( $fh, $output_file ) = - Perl::Tidy::streamhandle( $output_file, 'w', $is_encoded_data ); - unless ($fh) { Perl::Tidy::Die("Cannot write to output stream\n"); } - $output_file_open = 1; - } - - # in order to check output syntax when standard output is used, - # or when it is an object, we have to make a copy of the file - if ( $output_file eq '-' || ref $output_file ) { - if ( $rOpts->{'check-syntax'} ) { - - # Turning off syntax check when standard output is used. - # The reason is that temporary files cause problems on - # on many systems. - $rOpts->{'check-syntax'} = 0; - ${$rpending_logfile_message} .= < $fh,