I've stumbled upon something in the interpreter that I don't understand. While debuging a loop I added the following debug statement to see what was going on

warn "row=$row col=$col row->[col]=", $row->[$col], ";\n";

Fairly dull stuff, but I noticed that one of these debug lines was printed twice, and the first of the two lines had a ' (#1)' suffix tacked on the end. Correction: after the semicolon, but before the \n so it isn't quite the end but very close. As only one line out of hundreds had this, I was confused. Here is what I was seeing:

row=ARRAY(0x98e2c20) col=0 row->[col]=-output_format; row=ARRAY(0x98e2c20) col=1 row->[col]=csh; row=ARRAY(0x98e2c20) col=2 row->[col]=variable syntax; (#1) row=ARRAY(0x98e2c20) col=2 row->[col]=variable syntax; row=ARRAY(0x98e0de8) col=0 row->[col]=-platform; row=ARRAY(0x98e0de8) col=1 row->[col]=linux; row=ARRAY(0x98e0de8) col=2 row->[col]=$PLATFORM;

It appears that having syntax in a line sent written with  warn gets duplicated and has ' (#1)' tacked on. I don't see this with  print STDERR nor if I replace 'syntax' with another word.

Have I stumbled on some strange error detection logic I've never seen before? FWIW I'm using v5.10.0 on Ubuntu 9.04. I'm a good little monk, so I have  use strict; and  use warnings; at the top.

-doug


In reply to warn altering a line containting the word 'syntax' by doug

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.