Commit | Line | Data |
---|---|---|
94caac6e | 1 | use strict; |
2 | use warnings; | |
3 | ||
4 | print "1..1\n"; | |
5 | ||
6 | sub method { | |
7 | my ($pack, $name, $sub) = @_; | |
8 | no strict 'refs'; | |
9 | *{"${pack}::${name}"} = $sub; | |
10 | } | |
11 | ||
12 | use Devel::Declare 'method'; | |
13 | ||
14 | method bar { | |
15 | my $str = join(', ', @_); | |
16 | if ($str eq 'main, baz, quux') { | |
17 | print "ok 1\n"; | |
18 | } else { | |
19 | print "not ok 1\n"; | |
20 | } | |
21 | }; | |
22 | ||
23 | __PACKAGE__->bar(qw(baz quux)); |