I needed more or less the same thing some time ago. I settled on using File::ReadBackwards which did the job nicely. If you're happy with using a module for the job it's just the ticket.
Comment on Re: tail -1 emulation efficiency (use File::ReadBackwards)