Just a couple of things:
At line 10, you are using the two argument version of the open command. I opened a DOS window and tried the following:

copy c:\command.com c:\command2.com perl ptail.pl ">c:\command2.com"
Now command2.com is a 0 byte file. Not good. This can be avoided by using the three argument version like:
open (FH, "<", $file) || die "Unable to open $_: $!";

It also has an endless loop caused by line 18. while (1) will run forever since you do not provide a way to leaving this loop.

<nitpicking>And the program usage as displayed when run without command line arguments is only valid if you compile it.</nitpicking> =D

Update: Removed unnecessary grep string.


In reply to Re: tail and grep for Windows by Mr. Muskrat
in thread tail and grep for Windows by bizzach

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.