]> git.donarmstrong.com Git - perltidy.git/commitdiff
add sub write_tee_line
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 25 Apr 2020 13:39:57 +0000 (06:39 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 25 Apr 2020 13:39:57 +0000 (06:39 -0700)
lib/Perl/Tidy/LineSink.pm

index 511852fb3307362898cdee500a6c4aa8add6e567..96c245f62bdcf0dbd9c959e309d27514d4a4cfc7 100644 (file)
@@ -75,6 +75,21 @@ sub write_line {
     return;
 }
 
+sub write_tee_line {
+
+    # write line to tee file only...
+    # the original tee-on/tee-off method is being replaced because it 
+    # did not allow simultaneous tee-ing and deleting 
+
+    my ( $self, $line ) = @_;
+    chomp $line;
+    $line .= $self->{_line_separator};
+    unless ( $self->{_tee_file_opened} ) { $self->really_open_tee_file() }
+    my $fh_tee = $self->{_fh_tee};
+    print $fh_tee $line;
+    return;
+}
+
 sub tee_on {
     my $self = shift;
     $self->{_tee_flag} = 1;