in reply to read a file in both directions

A file handle only remembers one current position. If you want to deal with two then you'll need to store that information yourself. I suggest two variables to store the current forward and backward positions. tell will get you the data to store in those variables and seek will let you move between the two positions.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg