<?xml version="1.0" encoding="windows-1252"?>
<node id="76515" title="capturing STDOUT" created="2001-04-29 21:58:32" updated="2005-08-12 09:45:09">
<type id="115">
perlquestion</type>
<author id="29594">
nop</author>
<data>
<field name="doctext">
Hi.  I am using a module with a method that writes to STDOUT.  STDOUT is hardcoded; I'd prefer not go in and mess with the module.  How can I capture STDOUT into a variable?
&lt;code&gt;
my $a = ??? # do something to capture STDOUT into $a

# create a worksheet and fill
my $workbook = Spreadsheet::WriteExcel-&gt;new("-");
# do stuff to fill spreadsheet
$workbook-&gt;close;

???? # return STDOUT to standard location

# and now do something intesting with $a

&lt;/code&gt;
[nop]</field>
</data>
</node>
