"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Perl/Tidy/LineSink.pm" between
Perl-Tidy-20210402.tar.gz and Perl-Tidy-20210717.tar.gz

About: Perltidy is a Perl script indenter and reformatter (beautifier).

LineSink.pm  (Perl-Tidy-20210402):LineSink.pm  (Perl-Tidy-20210717)
##################################################################### #####################################################################
# #
# the Perl::Tidy::LineSink class supplies a write_line method for # the Perl::Tidy::LineSink class supplies a write_line method for
# actual file writing # actual file writing
# #
##################################################################### #####################################################################
package Perl::Tidy::LineSink; package Perl::Tidy::LineSink;
use strict; use strict;
use warnings; use warnings;
our $VERSION = '20210402'; our $VERSION = '20210717';
sub AUTOLOAD { sub AUTOLOAD {
# Catch any undefined sub calls so that we are sure to get # Catch any undefined sub calls so that we are sure to get
# some diagnostic information. This sub should never be called # some diagnostic information. This sub should never be called
# except for a programming error. # except for a programming error.
our $AUTOLOAD; our $AUTOLOAD;
return if ( $AUTOLOAD =~ /\bDESTROY$/ ); return if ( $AUTOLOAD =~ /\bDESTROY$/ );
my ( $pkg, $fname, $lno ) = caller(); my ( $pkg, $fname, $lno ) = caller();
my $my_package = __PACKAGE__; my $my_package = __PACKAGE__;
skipping to change at line 94 skipping to change at line 94
return bless { return bless {
_fh => $fh, _fh => $fh,
_output_file => $output_file, _output_file => $output_file,
_output_file_open => $output_file_open, _output_file_open => $output_file_open,
_line_separator => $line_separator, _line_separator => $line_separator,
_is_encoded_data => $is_encoded_data, _is_encoded_data => $is_encoded_data,
}, $class; }, $class;
} }
sub set_line_separator {
my ( $self, $val ) = @_;
$self->{_line_separator} = $val;
return;
}
sub write_line { sub write_line {
my ( $self, $line ) = @_; my ( $self, $line ) = @_;
my $fh = $self->{_fh}; my $fh = $self->{_fh};
my $output_file_open = $self->{_output_file_open}; my $line_separator = $self->{_line_separator};
chomp $line; if ( defined($line_separator) ) {
$line .= $self->{_line_separator}; chomp $line;
$line .= $line_separator;
}
$fh->print($line) if ( $self->{_output_file_open} ); $fh->print($line) if ( $self->{_output_file_open} );
return; return;
} }
sub close_output_file { sub close_output_file {
my $self = shift; my $self = shift;
# Only close physical files, not STDOUT and other objects # Only close physical files, not STDOUT and other objects
 End of changes. 3 change blocks. 
4 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)