Sean D. Rowe wrote at Thu, 26 Sep 2002 21:26:54 +0200:
> I need a function, like getline, which gets the previous line. I'm thinking
> I've read somewhere how to do this, but I can't remember where. Anyone
> know?
Use a variable holding always the last line:
my $previous_line = undef;
while (my $current_line = <FILE>) {
# do something with $current_line;
my $previous_line = $current_line;
}
Greetings,
Janek
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]