The synopsis says
# warn user (from perspective of caller) carp "string trimmed to 80 chars";
... while it's later corrected to ...
report the error as being from where your module was called.
(a behavior I actually prefer!)
More importantly it says
longmess( "message from cluck() or confess()" );
... but as you can see from the following example the first (i.e. current) line from cluck is omitted.
What am I missing?
use strict; use warnings; TEST::first(1); # 4 package TEST; use Carp qw/carp cluck longmess shortmess/; sub first { second(2); # 10 } sub second { # local $Carp::Verbose=1; carp "Carp Second"; cluck "Cluck Second"; # 16 print shortmess("Shortmess Second"); print longmess("Longmess Second"); }
Carp Second at d:/Users/lanx/pm/carp.pl line 4. Cluck Second at d:/Users/lanx/pm/carp.pl line 16. TEST::second(2) called at d:/Users/lanx/pm/carp.pl line 10 TEST::first(1) called at d:/Users/lanx/pm/carp.pl line 4 Shortmess Second at d:/Users/lanx/pm/carp.pl line 4. Longmess Second at d:/Users/lanx/pm/carp.pl line 10. TEST::first(1) called at d:/Users/lanx/pm/carp.pl line 4
Ironically after activating the $Carp::Verbose flag, shortmess becomes longer than longmess .
Shortmess Second at d:/Users/lanx/pm/carp.pl line 17. TEST::second(2) called at d:/Users/lanx/pm/carp.pl line 10 TEST::first(1) called at d:/Users/lanx/pm/carp.pl line 4 Longmess Second at d:/Users/lanx/pm/carp.pl line 10. TEST::first(1) called at d:/Users/lanx/pm/carp.pl line 4
wot???
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
translated the test to a proper module.pm in a separate file with the same result.
In reply to Carp::longmess not reporting the current line? by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |