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