open FILE, "<$filename" or die "Couldn't open $filename : $!\n";
seek (FILE,0,2);
for($i=-2048;1;$i-=2048){
seek (FILE,$i,1);
$/=undef;
$data=<FILE>;
if ($data=~m/\f([0-9][0-9]\/[0-9][0-9]\/[0-9][0-9])/){
$pos=tell (FILE);
print "$pos --pos\n";
last;
}
}
seek (FILE,$pos,0);
$/=undef;
$end=<FILE>;
print "$end\n";
> -----Original Message-----
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 06, 2002 4:44 PM
> To: 'Paul Kraus'; Perl
> Subject: RE: Seek tell
>
>
> > -----Original Message-----
> > From: Paul Kraus [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, December 06, 2002 4:42 PM
> > To: Perl
> > Subject: Seek tell
> >
> >
> > I am reading through a file.
> > I am testing it for a regexrp. If expr is true then I save
> the pos of
> > the file to a variable using tell.
> >
> > But it always the eof position an not the position directly
> before the
> > match. Any thoughts?
>
> Time to post your code :~)
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]