in reply to Re^2: How can I get Perl via Carp, to SCREAM -- more informative output via cluck(),confess(),longmess()?
in thread How can I get Perl via Carp, to SCREAM -- more informative output via cluck(),confess(),longmess()?

Undefined subroutine &main::confess

This is because you forgot to import the confess function. You're importing cluck, longmess and shortmess but nothing else from Carp:

use Carp qw(cluck longmess shortmess);

Really, longmess and shortmess are unlikely to be much use in end-user code. They might be helpful if you were writing an extension to Carp.

The four functions that are actually useful are croak, confess, carp, and cluck, and the least useful of these is cluck (which happens to be the only one of them that you're importing).

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
  • Comment on Re^3: How can I get Perl via Carp, to SCREAM -- more informative output via cluck(),confess(),longmess()?
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: How can I get Perl via Carp, to SCREAM -- more informative output via cluck(),confess(),longmess()?
by taint (Chaplain) on Dec 07, 2013 at 23:09 UTC
    Good points, tobyink.

    I should have caught the omission of confess, myself. Thanks for pointing it out. <blush>

    Thanks again.

    --Chris

    Hey. I'm not completely useless. I can be used as a bad example.