Perhaps some kind of two item queue.
--my @queue; # prime @queue with first line of data push @queue, scalar <DATA>; while (<DATA>) { push @queue, $_; if (/your condition/) { # edit line in $queue[0] } print shift @queue; } # print remaining queue print @queue;
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: edit text
by davorg
in thread edit text
by polr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |