AFAIK seek doesn't work in pipes. Because pipes are not random access but simple FIFOs.
The best option for you would be to implement a buffer yourself. Simple as that:
my @buffer=(); sub read_a_line { if (@buffer) { return shift @buffer; } else { my $x= <PIPE>; return $x; } } sub push_back_line { push @buffer, @_; }
In reply to Re: reset filehandle position on a buffered pipe in
by jethro
in thread reset filehandle position on a buffered pipe in
by johnvandam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |