This is the code for get_data() in the AGI. Within, there is a call to the execute() function, which further calls _execcommand() which already does this:
select ((select ($fh), $| = 1)[0]);
So it seems the get_data() already sets the enable auto flush to ON. Please let me know what exactly I would need to modify in get_data() or related functions.
Main Topics
Browse All Topics





by: Fairlight2cxPosted on 2009-07-02 at 03:22:02ID: 24761826
Generally speaking, the proper way to handle filehandles as far as getting them to be as unbuffered, you need to set $| = 1 on the filehandle. If it's not stdin/stdout/stderr, you must first select() the filehandle, set the autoflush state, then re-select the previously selected filehandle:
rlfaq5.htm l#How-do-I - flush%2fu nbuffer-an -output-fi lehandle%3 f--Why-mus t-I-do- thi s%3f
my $oldhandle = select(SOMEHANDLE);
$| = 1;
select($oldhandle);
My suspicion is that you need to alter AGI. It sounds like whatever filehandle get_data() is using is not set to autoflush as it should be. But it's not looking like you have access to that filehandle from the place in the code you're at--hence, changing AGI.
Further documentation on the issue may be found here:
http://perldoc.perl.org/pe