http://qs321.pair.com?node_id=11119557


in reply to carp always showing stacktrace

You are not calling the sub from a different module. The Carp documentation says right at the top (emphasis mine):

For a shorter message you can use carp() or croak() which report the error as being from where your module was called. shortmess() returns the contents of this error message.

Therefore this carps with the context of the call in main only:

use strict; use warnings; package Foo; use Carp; sub dbout { carp "@_"; } package main; Foo::dbout (1..3);

Here's the STDERR:

1 2 3 at /tmp/lanxcarp.pl line 14.

Replies are listed 'Best First'.
Re^2: carp always showing stacktrace
by LanX (Cardinal) on Jul 20, 2020 at 17:23 UTC
    > You are not calling the sub from a different module.

    Argh damn ... we had this discussion before...

    Thanks! :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery