Perhaps https://docs.perl6.org/language/exceptions#Catching_exceptions could be enlightening?
> On 11 Jan 2019, at 18:54, ToddAndMargo via perl6-users <perl6-us...@perl.org> > wrote: > > Hi All, > > I would like to do a Send Notify when a program of mine > crashes. > > How do I trap a crash? > > Is there a way to see some of the local variables in the > sub that crashes with the trap? > > > Many thanks, > -T > > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Computers are like air conditioners. > They malfunction when you open windows > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~