my $previous = <STDLOG>; while (my $current = <STDLOG>) { print "Current line is: $current"; print "Previous line is $previous"; $previous = $current; }
In reply to Re: How to get previous line of the file while processing current line in while loop
by JavaFan
in thread How to get previous line of the file while processing current line in while loop
by shan_emails
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |