Bumping version to 0.006022
[p5sagit/Devel-Declare.git] / t / debug.pl
CommitLineData
7dd7d008 1use strict;
2use warnings;
3
4use Devel::Declare;
5
6BEGIN {
7
8 Devel::Declare->install_declarator(
9 'DeclareTest', 'method', DECLARE_PACKAGE | DECLARE_PROTO,
10 sub {
11 my ($name, $proto) = @_;
12 return 'my $self = shift;' unless defined $proto && $proto ne '@_';
13 return 'my ($self'.(length $proto ? ", ${proto}" : "").') = @_;';
14 },
15 sub {
16 my ($name, $proto, $sub, @rest) = @_;
17 if (defined $name && length $name) {
18 unless ($name =~ /::/) {
19 $name = "DeclareTest::${name}";
20 }
21 no strict 'refs';
22 *{$name} = $sub;
23 }
24 return wantarray ? ($sub, @rest) : $sub;
25 }
26 );
27
28}
29
30my ($test_method1, $test_method2, @test_list);
31
32{
33 package DeclareTest;
34
35 method new {
36 };
37
38}
39
40{ no strict;
41 no warnings 'uninitialized';
42 print @{"_<t/debug.pl"};
43}