Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: carp always showing stacktrace

by hippo (Bishop)
on Jul 20, 2020 at 17:19 UTC ( [id://11119557]=note: print w/replies, xml ) Need Help??


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 (Saint) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119557]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found