in reply to Re: Warning given, but no line number provided.
in thread Warning given, but no line number provided.

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

Replies are listed 'Best First'.
Re^3: Warning given, but no line number provided.
by hv (Prior) on Aug 08, 2023 at 16:10 UTC

    I think it is very likely an oversight - I believe this is part of the ongoing series of improvements to locale handling by Karl Williamson. Please do report it.

      It's still happening on 5.40: Locale 'en_GB' is unsupported, and may hang or crash the interpreter
        It's still happening on 5.40: Locale 'en_GB' is unsupported, and may hang or crash the interpreter

        Please provide the output of perl -V

        Cheers,
        Rob