And look at how
File::Tail implements the tail too. You'll
learn a lot about perl from digging through this one. I
have special love for this question because it was the one
that sent me to c.l.p.m all those years ago. Imagine my
surprise when I flip thru the group and spot authors of
actual books that I own answering questions =)
Luckily, someone else had already asked the question
and been sent off to the Camel book. (look up seek).
Once you've seen the cute little 5ish lines that it takes
to do sketchy job of it, look in File::Tail at
"sub position" and see how cool they are in handling all the
cases and variations that we've never thought of.
This module is the other poster child (e.g. CGI) for
for people who think they can do it better and write it
more "efficiently" themselves.
Also, if your are going to use perl in the stream, it is
often not worth it to use unix tools and pipe, once you are
loading perl anyway, do the whole job in perl, you'll be
happy later, promise.
--
$you = new YOU;
honk() if $you->love(perl)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.