Skip to content

Commit

Permalink
I fail to see how this wasn't a problem before
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Miller committed Oct 7, 2013
1 parent bc48aab commit 59235b9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1273,19 +1273,23 @@ sub _debug {

$line = "[$short_fname line $line in sub $routine] $str\n";

if ( ref( $self->{debug} ) eq 'GLOB' ) {
print { $self->{debug} } $line;
if( exists $self->{debug} and defined $self->{debug} ) {

} elsif( $self->{debug} eq "warn" ) {
warn $line;
if ( ref( $self->{debug} ) eq 'GLOB' ) {
print { $self->{debug} } $line;

} elsif( $self->{debug} =~ m/^file:(.+)/ ) {
open my $out, ">>", $1 or warn "[log io fail: $@] $line";
print $out $line;
CORE::close($out);
} elsif( $self->{debug} eq "warn" ) {
warn $line;

} elsif( $self->{debug} =~ m/^file:(.+)/ ) {
open my $out, ">>", $1 or warn "[log io fail: $@] $line";
print $out $line;
CORE::close($out);

} else {
print STDOUT $line;
}

} else {
print STDOUT $line;
}

return;
Expand Down

0 comments on commit 59235b9

Please sign in to comment.