or you could use seek (SEEK_CUR) to get the file position information and store it in some variable and when you detect a new record, you just use seek (SEEK_SET) again to reposition the filepointer.my $line = ''; while(1) { $line = $line ? $line : <FH>; last unless defined $line; unless(isNewRecordLine($line)) { addToRecord($line); $line = ''; } else { processRecord(); } }
In reply to Re: unreadline function?
by esskar
in thread unreadline function?
by aquarium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |