Thanx a lot, you saved my life!

Geoffrey Young wrote:

>Martin Haase-Thomas wrote:
>
>>Hi all,
>>
>>instead of committing suicide after having tried and searched for all of
>>the day now i'd rather ask you:
>>does anyone know how to redirect STDOUT into a scalar variable,
>>so that a 'print "anything"' will not appear on STDOUT, but only in
>>my buffer?
>>
>
>try taking a look at Recipe 6.10 in the Cookbook (http://www.modperlcookbook.org/)...
>
>basically...
>
>tie *STDERR 'SomeClassThatImplementsTIEHANDLE'
>
># do something that writes to STDERR
>
>untie *STDERR
>
>the TIEHANDLE implementation can be anything you want: Apache (to send to your 
>browser), IO::String
>or IO::Scalar (to send to a variable), or whatnot...
>
>there's also an example in the Guide
>http://perl.apache.org/guide/porting.html#Redirecting_STDOUT_into_a_Scalar
>
>HTH
>
>--Geoff
># who is now contemplating a .sig for the first time :)
>

-- 
                   http://www.meome.de
-------------------------------------------------------
Martin Haase-Thomas         |       Tel.: 030 43730-558
meOme AG                    |       Fax.: 030 43730-555
Software Development        |           [EMAIL PROTECTED]
-------------------------------------------------------



Reply via email to