Subject: | Duplicate prefixes in error messages e.g. in Date::Calc & Date::Pcalc |
Carp::Clan usually prepends the qualified name of the function which
throws the error to the given error message.
Example:
My::Module::Function(): complains about something in file.pl at line 5
The problem arises when some modules also put the qualified name of the
function (or method) concerned into their messages, such as e.g.
Date::Calc and Date::Pcalc.
Example:
Show quoted text
>perl -MDate::Pcalc=:all -e "Calendar(0,0,0,0,0)"
This currently prints this:
Date::Pcalc::Calendar(): Usage:
Date::Pcalc::Calendar($year,$month[,$orthodox[,$lang]]) at -e line 1
When it should really print this:
Usage: Date::Pcalc::Calendar($year,$month[,$orthodox[,$lang]]) at -e line 1
The duplication of the qualified function name is annoying and ugly.
So Carp::Clan should be patched to only prepend this qualified function
name if the error message does not already contain it (anywhere in the
string).
The necessary patch is appended here.
I will also submit the new version of Carp::Clan 6.01 to CPAN.
Subject: | patch |