in reply to unreadline function?
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(); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:x2 unreadline function?
by grinder (Bishop) on Mar 01, 2004 at 08:55 UTC |