If this is on a DOSish system (which doesn't seem likely given the shebang line your using?) then you would need to move the binmode statement to after the open to which it applies for it to have any effect.

If your on a *nix system, then you shouldn't need the binmode (although I did see something about this changing under some circumstances with 5.8? -- Warning:Vague recollection), but if that is the case, then you probably wouldn't be seeing the problem.

Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

In reply to Re: File end marker problem by BrowserUk
in thread File end marker problem by DaveKelly

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