I'm aware of the PPT project, but to my mind they are shell tools, and do not have a modul(e|ar) interface so you can't "embed" them in your script, you have to backtick them, just like the original tail(1). I could be wrong about that though.

(A few moments later) hmmm no, it still looks like you can only run it as a child process, which is what I wanted to avoid. There is a sub named print_tail, which, according to its comments "Prints the tail of a file according to the options passed on the command line". I don't see a function that returns an array of scalars, which is what I was after.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

In reply to Re:x2 Performing a tail(1) in Perl (reading the last N lines of a file) by grinder
in thread Performing a tail(1) in Perl (reading the last N lines of a file) by grinder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":