The previous implementation had a couple problems that led me to take an alternate approach. Most importantly: reading bytes from an arbitrary point could easily read from the middle of a UTF-8 encoded character, which could cause a fatal error with a strict IO layer. Working around that (catching such errors or switching to raw mode for the seek and then back after) adds more complexity than I want in Path::Tiny. The new approach does this: when count is negative, it read all lines (thus respecting any requested I/O layers), but only returns the abs(count) at the end (or all lines if the file is smaller). Fixes #118.
The visit API now gives the callback a hashref for accumulating state and returns it at the end; this will avoid people having to create closures for their callbacks. The file is aliased to $_ for simple callbacks. The 'stop iterating' feature is changed to require a reference to a false scalar (\0), similar to Path::Iterator::Rule. This will help people who will forget to always return a true value. The default is now to always keep iterating and a special action is required to halt.