<code>
#!/usr/bin/env perl6
# Reference: https://docs.perl6.org/type/CallFrame
for 1..* -> $level {
given callframe($level) -> $frame {
when $frame ~~ CallFrame {
next unless $frame.code ~~ Routine;
say $frame.code.package;
last;
}
default {
say "no calling routine or method found";
last;
}
}
}
</code>
$ CallFrameTest.pl6
Died with X::Multi::NoMatch
in block at ./CallFrameTest.pl6 line 8
in block <unit> at ./CallFrameTest.pl6 line 5
Who called X::Multi::NoMatch? And zef has no record of it.
I pulled this out of the example on
https://docs.perl6.org/type/CallFrame
Many thanks,
-T