It's documented and I use that trick regularly to adjust the location.

Yes, I use the same trick, too - mainly in test suite scripts when I want to print an informative message (that's not actually a warning) to STDERR.
In such situations one doesn't want an "at line ..." appendix to appear, and doing warn "message\n" is less typing than print STDERR "message\n".

But, in this case with the problematic locale, I'm thinking the message is actually intended as a warning - and is enabled by the warnings pragma loaded by POSIX.pm.
Without the presence of the warnings pragma, that new locale warning won't appear ... and I'm wondering why the line number info is suppressed for this warning, yet every other warning from core perl that's enabled by the warnings pragma provides the additional info (AFAIK). Is it oversight or intentional ?

Maybe none of this matters - it just struck me as odd that perl would emit this warning (when warnings are enabled), but then withhold the location info.

UPDATE: As per hv's suggestion below, https://github.com/Perl/perl5/issues/21352 has been created.

Cheers,
Rob

In reply to Re^2: Warning given, but no line number provided. by syphilis
in thread Warning given, but no line number provided. by syphilis

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.