Try this:

#!/usr/bin/perl

package MySTDIN;

use strict;
use warnings;

use Tie::Handle;
our @ISA = qw(Tie::Handle);

Actually, you can remove the above two lines.


You just need to tie STDIN before it gets used, and alter the code in READLINE to alter the lines. Note you have to handle both scalar and array contexts.

I'm not completely sure of the correctness of the above. Use at your own risk.

And I think I've convinced myself that it is correct; anyone else?



-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to