I think that
btrott definitely has the right answer. It does not make sense to me to reinvent the wheel (an expression that
merlyn likes also) when somebody coded a module that "cooks everything for you".
I will go with
File::ReadBackwards, as it does exactly what I want.
Thanks all for your help, though!