Hi Guys,
I'm using a subclass of DBI called DBD::XBase for reading Oralce DBF tablespace
datafiles, translating them into delimited text files, and then loading them
into MySQL with DBI. The problem is the only way DBD:XBase can output the text
file with field delimiters I need is it slurps the whole file to STDOUT. So I
did this (don't laugh):
my $table = new XBase;
open STDOUT, ">data.txt";
$table->dump_records( "fs" => "|" );
close STDOUT;
This does exactly what I need, except that now STDOUT is closed for further
output (like for print statements), and if I do not close it, all STDOUT goes
to the data file (I told you not to laugh!).
I searched all night and cannot find an example of how to do this correctly.
Capture the table dump's STDOUT with IO::Pipe somehow? The documentation of
IO::Pipe is pretty sparse. Any suggestion is greatly appreciated.
tia,
mark