use strict;
package # hide from PAUSE
DBIx::Squirrel::Transform::IO;
BEGIN {
unless defined($DBIx::Squirrel::VERSION);
require Exporter;
$DBIx::Squirrel::Transform::IO::VERSION = $DBIx::Squirrel::VERSION;
@DBIx::Squirrel::Transform::IO::ISA = qw/Exporter/;
@DBIx::Squirrel::Transform::IO::EXPORT_OK = qw/stdout stderr/;
@DBIx::Squirrel::Transform::IO::EXPORT = @DBIx::Squirrel::Transform::IO::EXPORT_OK;
}
use DBIx::Squirrel::util qw/result/;
sub stdout {
if (@_) {
my $format = shift;
return sub {
printf STDOUT $format, @_;
return result;
}
}
else {
return sub {
printf STDOUT result;
return result;
}
}
}
sub stderr {
if (@_) {
my $format = shift;
return sub {
printf STDERR $format, @_;
return result;
}
}
else {
return sub {
printf STDERR result;
return result;
}
}
}
1;