Seek current position : file seek « File « Perl
- Perl
- File
- file seek
Seek current position
open(FH, "db") or die "Can't open datebook: $!\n";
while(<FH>){
last if /Tom/;
}
seek(FH,0,1) or die; # Seeking from the current position
$line=<FH>; # This is where the read starts again
print "$line";
close FH;
Related examples in the same category