in reply to Re^5: diagnostics: warning, deprecation, error
in thread diagnostics: warning, deprecation, error

You two removed the crucial file and line number.

  • Comment on Re^6: diagnostics: warning, deprecation, error

Replies are listed 'Best First'.
Re^7: diagnostics: warning, deprecation, error
by marto (Cardinal) on Feb 17, 2026 at 20:27 UTC

    This is not the case. On an unmodified perl running perl -MDerp::Derp outputs:

    perl -MDerp::Derp Can't locate Derp/Derp.pm in @INC (you may need to install the Derp::D +erp module) (@INC entries checked: /usr/lib/perl5/5.42/site_perl /usr +/share/perl5/site_perl /usr/lib/perl5/5.42/vendor_perl /usr/share/per +l5/vendor_perl /usr/lib/perl5/5.42/core_perl /usr/share/perl5/core_pe +rl). BEGIN failed--compilation aborted.

    Calling the same way from the patched perl produces the output shown here. From within a script we get the expected result:

    cat test.pl use Derp::Derp; ~/localperl/bin ./perl test.pl Can't locate Derp/Derp.pm in @INC See: perldoc -v @INC You may need to install the Derp::Derp module: https://metacpan.org/search?q=Derp::Derp @INC entries checked: /home/marto/localperl/lib/site_perl/5.42.0/x86_64-linux /home/marto/localperl/lib/site_perl/5.42.0 /home/marto/localperl/lib/5.42.0/x86_64-linux /home/marto/localperl/lib/5.42.0 at test.pl line 1. BEGIN failed--compilation aborted at test.pl line 1. ~/localperl/bin
Re^7: diagnostics: warning, deprecation, error
by pryrt (Abbot) on Feb 17, 2026 at 17:18 UTC
    Did they actually remove the file name and line number, or does that just not show up when using -M , even in the existing error message

    Because my experiments say the latter.

    C:\Users\pryrt>echo use Super::Duper; >> tmp.pl C:\Users\pryrt>perl tmp.pl Can't locate Super/Duper.pm in @INC (you may need to install the Super +::Duper module) (@INC entries checked: c:/usr/local/apps/strawberry/p +erl/site/lib/MSWin32-x64-multi-thread c:/usr/local/apps/strawberry/pe +rl/site/lib c:/usr/local/apps/strawberry/perl/vendor/lib c:/usr/local +/apps/strawberry/perl/lib) at tmp.pl line 1. BEGIN failed--compilation aborted at tmp.pl line 1. C:\Users\pryrt>perl use Super::Duper; Can't locate Super/Duper.pm in @INC (you may need to install the Super +::Duper module) (@INC entries checked: c:/usr/local/apps/strawberry/p +erl/site/lib/MSWin32-x64-multi-thread c:/usr/local/apps/strawberry/pe +rl/site/lib c:/usr/local/apps/strawberry/perl/vendor/lib c:/usr/local +/apps/strawberry/perl/lib) at - line 1. BEGIN failed--compilation aborted at - line 1. C:\Users\pryrt>perl -MSuper::Duper -e 1 Can't locate Super/Duper.pm in @INC (you may need to install the Super +::Duper module) (@INC entries checked: c:/usr/local/apps/strawberry/p +erl/site/lib/MSWin32-x64-multi-thread c:/usr/local/apps/strawberry/pe +rl/site/lib c:/usr/local/apps/strawberry/perl/vendor/lib c:/usr/local +/apps/strawberry/perl/lib). BEGIN failed--compilation aborted.

    I obviously cannot test whether marto's unpublished fix behaves the same way.

    But just because the example shows a situation in which the line number and file name aren't shown (because they are meaningless) doesn't mean that the solution proposed will actually get rid of that information when it's available.


    edit: I see that between the time I started my post and when I actually posted, the AM posted essentially the same information, with confirmation that their suggestion does not get rid of that information.
Re^7: diagnostics: warning, deprecation, error
by Anonymous Monk on Feb 17, 2026 at 16:42 UTC
    > You two removed the crucial file and line number.

    We did not. My example uses a bogus module on the -M switch to trigger Perl and when done like that she does not return file and line number not even good old at -e line 1. For that you need to run perl from a file:

    perl -MIPC::Cmd=run -Mautodie -le '$n="/tmp/blorp.pl";open$f,">",$n;pr +int$f "use Blorp;";close$f;@_=run(command=>"perl $n");$_=join"",@{$_[ +2]};s/ ([\(])/\n/g;s/ ([\/])/\n $1/g;s/\)//g;chomp;print'
    Can't locate Blorp.pm in @INC
    you may need to install the Blorp module
    @INC entries checked:
     /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0/darwin-2level
     /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0
     /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/darwin-2level
     /Users/u/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0 at
     /tmp/blorp.pl line 1.
    BEGIN failed--compilation aborted at
     /tmp/blorp.pl line 1.