8 BEGIN { $^P |= 0x210 } # PERLDBf_SUBLINE
12 my $foo_stash = Package::Stash->new('Foo');
14 # ----------------------------------------------------------------------
17 ok(!defined($Foo::{funk}), '... the &funk slot has not been created yet');
20 $foo_stash->add_symbol('&funk' => sub { "Foo::funk", __LINE__ });
21 }, undef, '... created &Foo::funk successfully');
23 ok(defined($Foo::{funk}), '... the &funk slot was created successfully');
27 ok(defined &{'Foo::funk'}, '... our &funk exists');
30 is((Foo->funk())[0], 'Foo::funk', '... got the right value from the function');
32 my $line = (Foo->funk())[1];
33 is $DB::sub{'Foo::funk'}, sprintf "%s:%d-%d", __FILE__, $line, $line,
34 '... got the right %DB::sub value for funk default args';
36 $foo_stash->add_symbol(
37 '&dunk' => sub { "Foo::dunk" },
38 filename => "FileName",
39 first_line_num => 100,
43 is $DB::sub{'Foo::dunk'}, sprintf "%s:%d-%d", "FileName", 100, 199,
44 '... got the right %DB::sub value for dunk with specified args';