By default, Raku's "die" reports the line number where the "die" is located, what if you'd like the line number of the calling context, ala "carp" with perl 5?
What's the raku analog of perl 5's carp?
239 Views Asked by Joseph Brenner At
2
There are 2 best solutions below
0
On
There is now a Carp module available on GitHub and should soon be available in the Raku ecosystem. It currently only supports the most basic functionality, but over time it should be improved.
So the answer to your question is to use Carp like you would in Perl 5. :-)
There is no direct equivalent to
carp, but you can start raku with the--ll-exceptionparameter, which will create a full stack trace on an execution error.I guess nobody has gotten around to creating a
Carpmodule yet. Creating acarpsub shouldn't be too difficult, given that there is aBacktraceclass: