in reply to Is there any module to strip error filename ?
If it's code that you don't have control over generating the error, such as in a CPAN module, then you might need to run it in an eval{} block, and modify the error message before re-throwing it.
eval { Some::Module::send_mail() }; if ($@) { (my $error = $@) =~ s/ at .* line \d+$//; die $error; }
|
|---|