Skip Menu |

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

Report information
The Basics
Id: 7261
Status: resolved
Worked: 30 min
Priority: 0/
Queue: IO-Capture

People
Owner: msreynolds [...] yahoo.com
Requestors: brian [...] alternation.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



Subject: printf() not captured
When using IO::Capture::Stdout you're required to use regular print() statements because printf isn't available. Sample Script: --- use strict; use warnings; use IO::Capture::Stdout; my $capture = IO::Capture::Stdout->new; $capture->start; printf( 'Test' ); $capture->stop; print $capture->read; --- Error Message: --- Can't locate object method "PRINTF" via package "IO::Capture::Tie_STDx" at iocap.pl line 9. --- -Brian
From: brian [...] alternation.net
[guest - Thu Aug 5 10:58:22 2004]: Show quoted text
> Error Message: > --- > Can't locate object method "PRINTF" via package > "IO::Capture::Tie_STDx" at iocap.pl line 9. > ---
As a follow-up, adding this to IO::Capture::Tie_STDx seems to work (more testing needed): sub PRINTF { my $self = shift; my $format = shift; $self->PRINT( sprintf( $format, @_ ) ); } -Brian
[guest - Thu Aug 5 11:07:56 2004]: Show quoted text
> [guest - Thu Aug 5 10:58:22 2004]: >
> > Error Message: > > --- > > Can't locate object method "PRINTF" via package > > "IO::Capture::Tie_STDx" at iocap.pl line 9. > > ---
> > As a follow-up, adding this to IO::Capture::Tie_STDx seems to work
(more Show quoted text
> testing needed): > > sub PRINTF { > my $self = shift; > my $format = shift; > $self->PRINT( sprintf( $format, @_ ) ); > } > > -Brian
Thanks! Added to next (0.04) release.