Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-All CPAN distribution.

Report information
The Basics
Id: 78390
Status: rejected
Priority: 0/
Queue: IO-All

People
Owner: Nobody in particular
Requestors: RHAXTON [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.44
Fixed in: (no value)



Subject: IO::All append fails on stdout "-"
I am trying to use the pattern: use IO::All; sub doThing { my $log = io($LOG_FILE_NAME); $log->append("Log Message 1\n"); $log->append("Log Message 2\n"); } if $LOG_FILE_NAME is "-" (for stdout) I get a "bad file descriptor at ..." error. My current work around is to do the following: sub doThing { my $log = io($LOG_FILE_NAME); $log->append("Log Message 1\n") unless $log->is_stdio; "Log Message 1\n" > $log if $log->is_stdio; $log->append("Log Message 2\n"); } After the if/unless, I can call append for both cases without issue.
On Sun Jul 15 18:23:57 2012, RHAXTON wrote: Show quoted text
> I am trying to use the pattern: > > use IO::All; > sub doThing > { > my $log = io($LOG_FILE_NAME); > $log->append("Log Message 1\n"); > $log->append("Log Message 2\n"); > > } > > if $LOG_FILE_NAME is "-" (for stdout) > > I get a "bad file descriptor at ..." > > error. > > My current work around is to do the following: > > sub doThing > { > my $log = io($LOG_FILE_NAME); > $log->append("Log Message 1\n") unless $log->is_stdio; > "Log Message 1\n" > $log if $log->is_stdio; > $log->append("Log Message 2\n"); > > } > > After the if/unless, I can call append for both cases without issue. > > >
Can't repro this, maybe try with a more recent version?