On Jul 8, 2005, at 7:36 AM, Alexandru Palade wrote:

The basic idea is that $chm->enum_files(...) outputs something to
stdout and I want to capture that and put it into $listing.
Unfortunately, $chm->enum_files(...) is actually a C function, and
when that C function writes to stdout, it gets on the screen
regardless of my redirection. I did a test and saw that if I replace
the $chm->enum_files(...) call with a print statement, the redirection
works (so it works fine from Perl-space).

Would fprintf help you?

Say that you replace instances of printf("foo%s", bar) in enum_files with fprintf(selected_handle, "foo%s", bar);

You then write a c_select function() which changes the value of selected_handle and call that each time you call Perl's select().

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/

Reply via email to