Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (19 sloc) 659 Bytes
use v6;
use Test;
plan 4;
# L<S06/The C<&?ROUTINE> object/current routine name>
# L<S02/Names/Which routine am I in>
sub foo { return &? }
is(foo(), '&Main::foo', 'got the right routine name in the default package');
# This testcase might be really redundant
package Bar {
sub bar { return &? }
is(bar(), '&Bar::bar', 'got the right routine name outside the default package');
my $bar = sub { return &? };
is($bar(), '<anon>', 'got the right routine name (anon-block)');
my $baz = try { &? };
ok(not(defined $baz), '&? not defined outside of a routine');
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.