The code runs fine on 5.005_03. At first I thought it was a question of the last line not having a terminating newline character but that's not the problem (although there may be a traing space or tab character on the line that could be giving it grief). Apart from the variables that aren't defined, I see no problem with this. Are you sure this fragment as is causes an error on your system, or is there a cut'n'paste problem?

Minor (major!) style issue, by convention, it is customary to use UPPERCASE heredoc labels. It makes things easier to follow.

Another issue beside the point is that you are not checking the result of your open call (Hi tilly!). One of these days you will reorganize your web directory tree and this script will quietly start to fail and you won't know why.

Three questions for you, 1) do you have use strict; at the top of your script and 2) does the first line of the script include the -w switch? What is Winnperl? What does "winnperl -v" produce as output?

--
g r i n d e r
just another bofh

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

In reply to Re: EOF in string by grinder
in thread EOF in string by Anonymous Monk

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.