|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
 use strict; use warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
51
 | 
    | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package Spiffy;  | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our $VERSION = '0.40';  | 
| 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
5
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
5
 | 
 use Carp;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
389
 | 
    | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 require Exporter;  | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our @EXPORT = ();  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our @EXPORT_BASE = qw(field const stub super);  | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our @EXPORT_OK = (@EXPORT_BASE, qw(id WWW XXX YYY ZZZ));  | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our %EXPORT_TAGS = (XXX => [qw(WWW XXX YYY ZZZ)]);  | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $stack_frame = 0;  | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $dump = 'yaml';  | 
| 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $bases_map = {};  | 
| 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub WWW; sub XXX; sub YYY; sub ZZZ;  | 
| 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # This line is here to convince "autouse" into believing we are autousable.  | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub can {  | 
| 
20
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     ($_[1] eq 'import' and caller()->isa('autouse'))  | 
| 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         ? \&Exporter::import        # pacify autouse's equality test  | 
| 
22
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         : $_[0]->SUPER::can($_[1])  # normal case  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
25
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # TODO  | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Exported functions like field and super should be hidden so as not to  | 
| 
28
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # be confused with methods that can be inherited.  | 
| 
29
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
31
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub new {  | 
| 
32
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $class = shift;  | 
| 
33
 | 
0
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     $class = ref($class) || $class;  | 
| 
34
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $self = bless {}, $class;  | 
| 
35
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     while (@_) {  | 
| 
36
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         my $method = shift;  | 
| 
37
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $self->$method(shift);  | 
| 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
39
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $self;  | 
| 
40
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
41
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $filtered_files = {};  | 
| 
43
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $filter_dump = 0;  | 
| 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $filter_save = 0;  | 
| 
45
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our $filter_result = '';  | 
| 
46
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub import {  | 
| 
47
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
33
 | 
    | 
| 
48
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
5
 | 
     no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1381
 | 
    | 
| 
49
 | 
3
 | 
 
 | 
 
 | 
  
3
  
 | 
 
 | 
7
 | 
     my $self_package = shift;  | 
| 
50
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
51
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # XXX Using parse_arguments here might cause confusion, because the  | 
| 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # subclass's boolean_arguments and paired_arguments can conflict, causing  | 
| 
53
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # difficult debugging. Consider using something truly local.  | 
| 
54
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
7
 | 
     my ($args, @export_list) = do {  | 
| 
55
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         local *boolean_arguments = sub {  | 
| 
56
 | 
3
 | 
 
 | 
 
 | 
  
3
  
 | 
 
 | 
14
 | 
             qw(  | 
| 
57
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 -base -Base -mixin -selfless  | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 -XXX -dumper -yaml  | 
| 
59
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 -filter_dump -filter_save  | 
| 
60
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             )  | 
| 
61
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
34
 | 
         };  | 
| 
62
 | 
3
 | 
 
 | 
 
 | 
  
3
  
 | 
 
 | 
13
 | 
         local *paired_arguments = sub { qw(-package) };  | 
| 
 
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
    | 
| 
63
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
28
 | 
         $self_package->parse_arguments(@_);  | 
| 
64
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     };  | 
| 
65
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
13
 | 
     return spiffy_mixin_import(scalar(caller(0)), $self_package, @export_list)  | 
| 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if $args->{-mixin};  | 
| 
67
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
68
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
9
 | 
     $filter_dump = 1 if $args->{-filter_dump};  | 
| 
69
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
9
 | 
     $filter_save = 1 if $args->{-filter_save};  | 
| 
70
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
9
 | 
     $dump = 'yaml' if $args->{-yaml};  | 
| 
71
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
7
 | 
     $dump = 'dumper' if $args->{-dumper};  | 
| 
72
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
73
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
     local @EXPORT_BASE = @EXPORT_BASE;  | 
| 
74
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
75
 | 
3
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
10
 | 
     if ($args->{-XXX}) {  | 
| 
76
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         push @EXPORT_BASE, @{$EXPORT_TAGS{XXX}}  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
77
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           unless grep /^XXX$/, @EXPORT_BASE;  | 
| 
78
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
79
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
80
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     spiffy_filter()  | 
| 
81
 | 
3
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
43
 | 
       if ($args->{-selfless} or $args->{-Base}) and  | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
82
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
          not $filtered_files->{(caller($stack_frame))[1]}++;  | 
| 
83
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
84
 | 
3
 | 
 
 | 
  
 33
  
 | 
 
 | 
 
 | 
83
 | 
     my $caller_package = $args->{-package} || caller($stack_frame);  | 
| 
85
 | 
3
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
21
 | 
     push @{"$caller_package\::ISA"}, $self_package  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
    | 
| 
86
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if $args->{-Base} or $args->{-base};  | 
| 
87
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
88
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
7
 | 
     for my $class (@{all_my_bases($self_package)}) {  | 
| 
 
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
9
 | 
    | 
| 
89
 | 
4
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
35
 | 
         next unless $class->isa('Spiffy');  | 
| 
90
 | 
55
 | 
 
 | 
 
 | 
 
 | 
 
 | 
212
 | 
         my @export = grep {  | 
| 
91
 | 
55
 | 
 
 | 
 
 | 
 
 | 
 
 | 
49
 | 
             not defined &{"$caller_package\::$_"};  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
    | 
| 
92
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6
 | 
         } ( @{"$class\::EXPORT"},  | 
| 
93
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             ($args->{-Base} or $args->{-base})  | 
| 
94
 | 
4
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
6
 | 
               ? @{"$class\::EXPORT_BASE"} : (),  | 
| 
95
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           );  | 
| 
96
 | 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
99
 | 
         my @export_ok = grep {  | 
| 
97
 | 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
             not defined &{"$caller_package\::$_"};  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
    | 
| 
98
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
8
 | 
         } @{"$class\::EXPORT_OK"};  | 
| 
99
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
100
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         # Avoid calling the expensive Exporter::export  | 
| 
101
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         # if there is nothing to do (optimization)  | 
| 
102
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
         my %exportable = map { ($_, 1) } @export, @export_ok;  | 
| 
 
 | 
74
 | 
 
 | 
 
 | 
 
 | 
 
 | 
138
 | 
    | 
| 
103
 | 
4
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
29
 | 
         next unless keys %exportable;  | 
| 
104
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
105
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
7
 | 
         my @export_save = @{"$class\::EXPORT"};  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
    | 
| 
106
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6
 | 
         my @export_ok_save = @{"$class\::EXPORT_OK"};  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
    | 
| 
107
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
         @{"$class\::EXPORT"} = @export;  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
    | 
| 
108
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
8
 | 
         @{"$class\::EXPORT_OK"} = @export_ok;  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
    | 
| 
109
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
         my @list = grep {  | 
| 
110
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
9
 | 
             (my $v = $_) =~ s/^[\!\:]//;  | 
| 
111
 | 
5
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
17
 | 
             $exportable{$v} or ${"$class\::EXPORT_TAGS"}{$v};  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20
 | 
    | 
| 
112
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         } @export_list;  | 
| 
113
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
596
 | 
         Exporter::export($class, $caller_package, @list);  | 
| 
114
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
8
 | 
         @{"$class\::EXPORT"} = @export_save;  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
21
 | 
    | 
| 
115
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
9
 | 
         @{"$class\::EXPORT_OK"} = @export_ok_save;  | 
| 
 
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
156
 | 
    | 
| 
116
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
117
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
118
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
119
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub spiffy_filter {  | 
| 
120
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
1791
 | 
     require Filter::Util::Call;  | 
| 
121
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1243
 | 
     my $done = 0;  | 
| 
122
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     Filter::Util::Call::filter_add(  | 
| 
123
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         sub {  | 
| 
124
 | 
2
 | 
  
100
  
 | 
 
 | 
  
2
  
 | 
 
 | 
59
 | 
             return 0 if $done;  | 
| 
125
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4
 | 
             my ($data, $end) = ('', '');  | 
| 
126
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
             while (my $status = Filter::Util::Call::filter_read()) {  | 
| 
127
 | 
688
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
1007
 | 
                 return $status if $status < 0;  | 
| 
128
 | 
688
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
1104
 | 
                 if (/^__(?:END|DATA)__\r?$/) {  | 
| 
129
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     $end = $_;  | 
| 
130
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                     last;  | 
| 
131
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 }  | 
| 
132
 | 
688
 | 
 
 | 
 
 | 
 
 | 
 
 | 
741
 | 
                 $data .= $_;  | 
| 
133
 | 
688
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10628
 | 
                 $_ = '';  | 
| 
134
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
135
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
36
 | 
             $_ = $data;  | 
| 
136
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
             my @my_subs;  | 
| 
137
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
210
 | 
             s[^(sub\s+\w+\s+\{)(.*\n)]  | 
| 
138
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
              [${1}my \$self = shift;$2]gm;  | 
| 
139
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
161
 | 
             s[^(sub\s+\w+)\s*\(\s*\)(\s+\{.*\n)]  | 
| 
140
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
              [${1}${2}]gm;  | 
| 
141
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
70
 | 
             s[^my\s+sub\s+(\w+)(\s+\{)(.*)((?s:.*?\n))\}\n]  | 
| 
142
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
              [push @my_subs, $1; "\$$1 = sub$2my \$self = shift;$3$4\};\n"]gem;  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
143
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4
 | 
             my $preclare = '';  | 
| 
144
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
5
 | 
             if (@my_subs) {  | 
| 
145
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $preclare = join ',', map "\$$_", @my_subs;  | 
| 
146
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
                 $preclare = "my($preclare);";  | 
| 
147
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             }  | 
| 
148
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
47
 | 
             $_ = "use strict;use warnings;$preclare${_};1;\n$end";  | 
| 
149
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
10
 | 
             if ($filter_dump) { print; exit }  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
150
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
5
 | 
             if ($filter_save) { $filter_result = $_; $_ = $filter_result; }  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
151
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
182
 | 
             $done = 1;  | 
| 
152
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
153
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
11
 | 
     );  | 
| 
154
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
155
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub base {  | 
| 
157
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     push @_, -base;  | 
| 
158
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     goto &import;  | 
| 
159
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
160
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
161
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub all_my_bases {  | 
| 
162
 | 
4
 | 
 
 | 
 
 | 
  
4
  
 | 
  
0
  
 | 
7
 | 
     my $class = shift;  | 
| 
163
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
164
 | 
4
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
17
 | 
     return $bases_map->{$class}  | 
| 
165
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if defined $bases_map->{$class};  | 
| 
166
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
167
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
     my @bases = ($class);  | 
| 
168
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
7
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
260
 | 
    | 
| 
169
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4
 | 
     for my $base_class (@{"${class}::ISA"}) {  | 
| 
 
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
    | 
| 
170
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1
 | 
         push @bases, @{all_my_bases($base_class)};  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6
 | 
    | 
| 
171
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
172
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
     my $used = {};  | 
| 
173
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
     $bases_map->{$class} = [grep {not $used->{$_}++} @bases];  | 
| 
 
 | 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
19
 | 
    | 
| 
174
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
175
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
176
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my %code = (  | 
| 
177
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     sub_start =>  | 
| 
178
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "sub {\n",  | 
| 
179
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     set_default =>  | 
| 
180
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  \$_[0]->{%s} = %s\n    unless exists \$_[0]->{%s};\n",  | 
| 
181
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     init =>  | 
| 
182
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  return \$_[0]->{%s} = do { my \$self = \$_[0]; %s }\n" .  | 
| 
183
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "    unless \$#_ > 0 or defined \$_[0]->{%s};\n",  | 
| 
184
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     weak_init =>  | 
| 
185
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  return do {\n" .  | 
| 
186
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "    \$_[0]->{%s} = do { my \$self = \$_[0]; %s };\n" .  | 
| 
187
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "    Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n" .  | 
| 
188
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "    \$_[0]->{%s};\n" .  | 
| 
189
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  } unless \$#_ > 0 or defined \$_[0]->{%s};\n",  | 
| 
190
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return_if_get =>  | 
| 
191
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  return \$_[0]->{%s} unless \$#_ > 0;\n",  | 
| 
192
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     set =>  | 
| 
193
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  \$_[0]->{%s} = \$_[1];\n",  | 
| 
194
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     weaken =>  | 
| 
195
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  Scalar::Util::weaken(\$_[0]->{%s}) if ref \$_[0]->{%s};\n",  | 
| 
196
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     sub_end =>  | 
| 
197
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       "  return \$_[0]->{%s};\n}\n",  | 
| 
198
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 );  | 
| 
199
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
200
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub field {  | 
| 
201
 | 
17
 | 
 
 | 
 
 | 
  
17
  
 | 
  
0
  
 | 
26
 | 
     my $package = caller;  | 
| 
202
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
47
 | 
     my ($args, @values) = do {  | 
| 
203
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
         no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
410
 | 
    | 
| 
204
 | 
17
 | 
 
 | 
 
 | 
  
17
  
 | 
 
 | 
56
 | 
         local *boolean_arguments = sub { (qw(-weak)) };  | 
| 
 
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
29
 | 
    | 
| 
205
 | 
17
 | 
 
 | 
 
 | 
  
17
  
 | 
 
 | 
53
 | 
         local *paired_arguments = sub { (qw(-package -init)) };  | 
| 
 
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
30
 | 
    | 
| 
206
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
45
 | 
         Spiffy->parse_arguments(@_);  | 
| 
207
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     };  | 
| 
208
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
32
 | 
     my ($field, $default) = @values;  | 
| 
209
 | 
17
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
44
 | 
     $package = $args->{-package} if defined $args->{-package};  | 
| 
210
 | 
17
 | 
  
 50
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
173
 | 
     die "Cannot have a default for a weakened field ($field)"  | 
| 
211
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         if defined $default && $args->{-weak};  | 
| 
212
 | 
17
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
18
 | 
     return if defined &{"${package}::$field"};  | 
| 
 
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
93
 | 
    | 
| 
213
 | 
17
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
34
 | 
     require Scalar::Util if $args->{-weak};  | 
| 
214
 | 
17
 | 
  
100
  
 | 
  
100
  
 | 
 
 | 
 
 | 
87
 | 
     my $default_string =  | 
| 
 
 | 
 
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
215
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         ( ref($default) eq 'ARRAY' and not @$default )  | 
| 
216
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         ? '[]'  | 
| 
217
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         : (ref($default) eq 'HASH' and not keys %$default )  | 
| 
218
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           ? '{}'  | 
| 
219
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           : default_as_code($default);  | 
| 
220
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
221
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26
 | 
     my $code = $code{sub_start};  | 
| 
222
 | 
17
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
42
 | 
     if ($args->{-init}) {  | 
| 
223
 | 
4
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
12
 | 
         my $fragment = $args->{-weak} ? $code{weak_init} : $code{init};  | 
| 
224
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
22
 | 
         my @count = ($fragment =~ /(%s)/g);  | 
| 
225
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
24
 | 
         $code .= sprintf $fragment, $field, $args->{-init}, ($field) x (@count - 2);  | 
| 
226
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
227
 | 
17
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
52
 | 
     $code .= sprintf $code{set_default}, $field, $default_string, $field  | 
| 
228
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if defined $default;  | 
| 
229
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
39
 | 
     $code .= sprintf $code{return_if_get}, $field;  | 
| 
230
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
31
 | 
     $code .= sprintf $code{set}, $field;  | 
| 
231
 | 
17
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
34
 | 
     $code .= sprintf $code{weaken}, $field, $field  | 
| 
232
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if $args->{-weak};  | 
| 
233
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
30
 | 
     $code .= sprintf $code{sub_end}, $field;  | 
| 
234
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
235
 | 
17
 | 
  
  0
  
 | 
  
  0
  
 | 
  
0
  
 | 
 
 | 
2086
 | 
     my $sub = eval $code;  | 
| 
 
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
236
 | 
17
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
37
 | 
     die $@ if $@;  | 
| 
237
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
226
 | 
    | 
| 
238
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
21
 | 
     *{"${package}::$field"} = $sub;  | 
| 
 
 | 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
70
 | 
    | 
| 
239
 | 
17
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
69
 | 
     return $code if defined wantarray;  | 
| 
240
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
241
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
242
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub default_as_code {  | 
| 
243
 | 
14
 | 
 
 | 
 
 | 
  
14
  
 | 
  
0
  
 | 
23547
 | 
     require Data::Dumper;  | 
| 
244
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13960
 | 
     local $Data::Dumper::Sortkeys = 1;  | 
| 
245
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
31
 | 
     my $code = Data::Dumper::Dumper(shift);  | 
| 
246
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
701
 | 
     $code =~ s/^\$VAR1 = //;  | 
| 
247
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
34
 | 
     $code =~ s/;$//;  | 
| 
248
 | 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
33
 | 
     return $code;  | 
| 
249
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
250
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
251
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub const {  | 
| 
252
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $package = caller;  | 
| 
253
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($args, @values) = do {  | 
| 
254
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
         no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
114
 | 
    | 
| 
255
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
         local *paired_arguments = sub { (qw(-package)) };  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
256
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         Spiffy->parse_arguments(@_);  | 
| 
257
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     };  | 
| 
258
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($field, $default) = @values;  | 
| 
259
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $package = $args->{-package} if defined $args->{-package};  | 
| 
260
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
5
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
837
 | 
    | 
| 
261
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return if defined &{"${package}::$field"};  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
262
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
     *{"${package}::$field"} = sub { $default }  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
263
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
 }  | 
| 
264
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
265
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub stub {  | 
| 
266
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $package = caller;  | 
| 
267
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($args, @values) = do {  | 
| 
268
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
8
 | 
         no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
143
 | 
    | 
| 
269
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
         local *paired_arguments = sub { (qw(-package)) };  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
270
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         Spiffy->parse_arguments(@_);  | 
| 
271
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     };  | 
| 
272
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my ($field, $default) = @values;  | 
| 
273
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     $package = $args->{-package} if defined $args->{-package};  | 
| 
274
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
14
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
581
 | 
    | 
| 
275
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return if defined &{"${package}::$field"};  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
276
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     *{"${package}::$field"} =  | 
| 
277
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     sub {  | 
| 
278
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
         require Carp;  | 
| 
279
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         Carp::confess  | 
| 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           "Method $field in package $package must be subclassed";  | 
| 
281
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
282
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
 }  | 
| 
283
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
284
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub parse_arguments {  | 
| 
285
 | 
20
 | 
 
 | 
 
 | 
  
20
  
 | 
  
0
  
 | 
25
 | 
     my $class = shift;  | 
| 
286
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
38
 | 
     my ($args, @values) = ({}, ());  | 
| 
287
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
50
 | 
     my %booleans = map { ($_, 1) } $class->boolean_arguments;  | 
| 
 
 | 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
119
 | 
    | 
| 
288
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
61
 | 
     my %pairs = map { ($_, 1) } $class->paired_arguments;  | 
| 
 
 | 
37
 | 
 
 | 
 
 | 
 
 | 
 
 | 
82
 | 
    | 
| 
289
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
55
 | 
     while (@_) {  | 
| 
290
 | 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
38
 | 
         my $elem = shift;  | 
| 
291
 | 
33
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
244
 | 
         if (defined $elem and defined $booleans{$elem}) {  | 
| 
 
 | 
 
 | 
  
100
  
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
 
 | 
 
 | 
  
 66
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
292
 | 
1
 | 
  
 50
  
 | 
  
 33
  
 | 
 
 | 
 
 | 
9
 | 
             $args->{$elem} = (@_ and $_[0] =~ /^[01]$/)  | 
| 
293
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             ? shift  | 
| 
294
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             : 1;  | 
| 
295
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
296
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         elsif (defined $elem and defined $pairs{$elem} and @_) {  | 
| 
297
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13
 | 
             $args->{$elem} = shift;  | 
| 
298
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
299
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         else {  | 
| 
300
 | 
28
 | 
 
 | 
 
 | 
 
 | 
 
 | 
70
 | 
             push @values, $elem;  | 
| 
301
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
302
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
303
 | 
20
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
185
 | 
     return wantarray ? ($args, @values) : $args;  | 
| 
304
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
305
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
306
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
 sub boolean_arguments { () }  | 
| 
307
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
 sub paired_arguments { () }  | 
| 
308
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
309
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # get a unique id for any node  | 
| 
310
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub id {  | 
| 
311
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     if (not ref $_[0]) {  | 
| 
312
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return 'undef' if not defined $_[0];  | 
| 
313
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         \$_[0] =~ /\((\w+)\)$/o or die;  | 
| 
314
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return "$1-S";  | 
| 
315
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
316
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     require overload;  | 
| 
317
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     overload::StrVal($_[0]) =~ /\((\w+)\)$/o or die;  | 
| 
318
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return $1;  | 
| 
319
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
320
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
321
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #===============================================================================  | 
| 
322
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # It's super, man.  | 
| 
323
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #===============================================================================  | 
| 
324
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package DB;  | 
| 
325
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 {  | 
| 
326
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no warnings 'redefine';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
393
 | 
    | 
| 
327
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     sub super_args {  | 
| 
328
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
         my @dummy = caller(@_ ? $_[0] : 2);  | 
| 
329
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return @DB::args;  | 
| 
330
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
331
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
332
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
333
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package Spiffy;  | 
| 
334
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub super {  | 
| 
335
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
0
 | 
     my $method;  | 
| 
336
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $frame = 1;  | 
| 
337
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     while ($method = (caller($frame++))[3]) {  | 
| 
338
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         $method =~ s/.*::// and last;  | 
| 
339
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
340
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my @args = DB::super_args($frame);  | 
| 
341
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     @_ = @_ ? ($args[0], @_) : @args;  | 
| 
342
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $class = ref $_[0] ? ref $_[0] : $_[0];  | 
| 
343
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $caller_class = caller;  | 
| 
344
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     my $seen = 0;  | 
| 
345
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
0
 | 
     my @super_classes = reverse grep {  | 
| 
346
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         ($seen or $seen = ($_ eq $caller_class)) ? 0 : 1;  | 
| 
347
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     } reverse @{all_my_bases($class)};  | 
| 
348
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     for my $super_class (@super_classes) {  | 
| 
349
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
7
 | 
         no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
292
 | 
    | 
| 
350
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         next if $super_class eq $class;  | 
| 
351
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         if (defined &{"${super_class}::$method"}) {  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
352
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             ${"$super_class\::AUTOLOAD"} = ${"$class\::AUTOLOAD"}  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
353
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               if $method eq 'AUTOLOAD';  | 
| 
354
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
             return &{"${super_class}::$method"};  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
    | 
| 
355
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
356
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
357
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     return;  | 
| 
358
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
359
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
360
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #===============================================================================  | 
| 
361
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # This code deserves a spanking, because it is being very naughty.  | 
| 
362
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # It is exchanging base.pm's import() for its own, so that people  | 
| 
363
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # can use base.pm with Spiffy modules, without being the wiser.  | 
| 
364
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #===============================================================================  | 
| 
365
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $real_base_import;  | 
| 
366
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 my $real_mixin_import;  | 
| 
367
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
368
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 BEGIN {  | 
| 
369
 | 
1
 | 
  
 50
  
 | 
 
 | 
  
1
  
 | 
 
 | 
5
 | 
     require base unless defined $INC{'base.pm'};  | 
| 
370
 | 
1
 | 
 
 | 
  
 50
  
 | 
 
 | 
 
 | 
8
 | 
     $INC{'mixin.pm'} ||= 'Spiffy/mixin.pm';  | 
| 
371
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
     $real_base_import = \&base::import;  | 
| 
372
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
     $real_mixin_import = \&mixin::import;  | 
| 
373
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
7
 | 
     no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
77
 | 
    | 
| 
374
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
     *base::import = \&spiffy_base_import;  | 
| 
375
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
58
 | 
     *mixin::import = \&spiffy_mixin_import;  | 
| 
376
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
377
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
378
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # my $i = 0;  | 
| 
379
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # while (my $caller = caller($i++)) {  | 
| 
380
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #     next unless $caller eq 'base' or $caller eq 'mixin';  | 
| 
381
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #     croak <
 | 
| 
382
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Spiffy.pm must be loaded before calling 'use base' or 'use mixin' with a  | 
| 
383
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Spiffy module. See the documentation of Spiffy.pm for details.  | 
| 
384
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # END  | 
| 
385
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # }  | 
| 
386
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
387
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub spiffy_base_import {  | 
| 
388
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
  
0
  
 | 
95
 | 
     my @base_classes = @_;  | 
| 
389
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
     shift @base_classes;  | 
| 
390
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
334
 | 
    | 
| 
391
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
     goto &$real_base_import  | 
| 
392
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       unless grep {  | 
| 
393
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
3
 | 
           eval "require $_" unless %{"$_\::"};  | 
| 
 
 | 
1
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
394
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
89
 | 
           $_->isa('Spiffy');  | 
| 
395
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       } @base_classes;  | 
| 
396
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $inheritor = caller(0);  | 
| 
397
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     for my $base_class (@base_classes) {  | 
| 
398
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         next if $inheritor->isa($base_class);  | 
| 
399
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         croak "Can't mix Spiffy and non-Spiffy classes in 'use base'.\n",  | 
| 
400
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
               "See the documentation of Spiffy.pm for details\n  "  | 
| 
401
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           unless $base_class->isa('Spiffy');  | 
| 
402
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $stack_frame = 1; # tell import to use different caller  | 
| 
403
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         import($base_class, '-base');  | 
| 
404
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $stack_frame = 0;  | 
| 
405
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
406
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
407
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
408
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub mixin {  | 
| 
409
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     my $self = shift;  | 
| 
410
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $target_class = ref($self);  | 
| 
411
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     spiffy_mixin_import($target_class, @_)  | 
| 
412
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
413
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
414
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub spiffy_mixin_import {  | 
| 
415
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     my $target_class = shift;  | 
| 
416
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     $target_class = caller(0)  | 
| 
417
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if $target_class eq 'mixin';  | 
| 
418
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $mixin_class = shift  | 
| 
419
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       or die "Nothing to mixin";  | 
| 
420
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     eval "require $mixin_class";  | 
| 
421
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my @roles = @_;  | 
| 
422
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $pseudo_class = join '-', $target_class, $mixin_class, @roles;  | 
| 
423
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my %methods = spiffy_mixin_methods($mixin_class, @roles);  | 
| 
424
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
27
 | 
    | 
| 
425
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
4
 | 
     no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
145
 | 
    | 
| 
426
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     @{"$pseudo_class\::ISA"} = @{"$target_class\::ISA"};  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
427
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     @{"$target_class\::ISA"} = ($pseudo_class);  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
428
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     for (keys %methods) {  | 
| 
429
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         *{"$pseudo_class\::$_"} = $methods{$_};  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
430
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
431
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
432
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
433
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub spiffy_mixin_methods {  | 
| 
434
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     my $mixin_class = shift;  | 
| 
435
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
504
 | 
    | 
| 
436
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my %methods = spiffy_all_methods($mixin_class);  | 
| 
437
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     map {  | 
| 
438
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $methods{$_}  | 
| 
439
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           ? ($_, \ &{"$methods{$_}\::$_"})  | 
| 
440
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           : ($_, \ &{"$mixin_class\::$_"})  | 
| 
441
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     } @_  | 
| 
442
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       ? (get_roles($mixin_class, @_))  | 
| 
443
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       : (keys %methods);  | 
| 
444
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
445
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
446
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub get_roles {  | 
| 
447
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     my $mixin_class = shift;  | 
| 
448
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my @roles = @_;  | 
| 
449
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     while (grep /^!*:/, @roles) {  | 
| 
450
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         @roles = map {  | 
| 
451
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             s/!!//g;  | 
| 
452
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             /^!:(.*)/ ? do {  | 
| 
453
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 my $m = "_role_$1";  | 
| 
454
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 map("!$_", $mixin_class->$m);  | 
| 
455
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             } :  | 
| 
456
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             /^:(.*)/ ? do {  | 
| 
 
 | 
 
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
457
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 my $m = "_role_$1";  | 
| 
458
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 ($mixin_class->$m);  | 
| 
459
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             } :  | 
| 
460
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
             ($_)  | 
| 
461
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         } @roles;  | 
| 
462
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
463
 | 
0
 | 
  
  0
  
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
     if (@roles and $roles[0] =~ /^!/) {  | 
| 
464
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         my %methods = spiffy_all_methods($mixin_class);  | 
| 
465
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         unshift @roles, keys(%methods);  | 
| 
466
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
467
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my %roles;  | 
| 
468
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     for (@roles) {  | 
| 
469
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         s/!!//g;  | 
| 
470
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         delete $roles{$1}, next  | 
| 
471
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
           if /^!(.*)/;  | 
| 
472
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $roles{$_} = 1;  | 
| 
473
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
474
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     keys %roles;  | 
| 
475
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
476
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
477
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub spiffy_all_methods {  | 
| 
478
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
6
 | 
     no strict 'refs';  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
2
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
197
 | 
    | 
| 
479
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     my $class = shift;  | 
| 
480
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return if $class eq 'Spiffy';  | 
| 
481
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my %methods = map {  | 
| 
482
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         ($_, $class)  | 
| 
483
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     } grep {  | 
| 
484
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         defined &{"$class\::$_"} and not /^_/  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
485
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     } keys %{"$class\::"};  | 
| 
486
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my %super_methods;  | 
| 
487
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     %super_methods = spiffy_all_methods(${"$class\::ISA"}[0])  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
488
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
       if @{"$class\::ISA"};  | 
| 
489
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     %{{%super_methods, %methods}};  | 
| 
 
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
490
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
491
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
492
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
493
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # END of naughty code.  | 
| 
494
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #===============================================================================  | 
| 
495
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Debugging support  | 
| 
496
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #===============================================================================  | 
| 
497
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub spiffy_dump {  | 
| 
498
 | 
1
 | 
 
 | 
 
 | 
  
1
  
 | 
 
 | 
5
 | 
     no warnings;  | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3
 | 
    | 
| 
 
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
602
 | 
    | 
| 
499
 | 
0
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     if ($dump eq 'dumper') {  | 
| 
500
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         require Data::Dumper;  | 
| 
501
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $Data::Dumper::Sortkeys = 1;  | 
| 
502
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $Data::Dumper::Indent = 1;  | 
| 
503
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         return Data::Dumper::Dumper(@_);  | 
| 
504
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
505
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     require YAML;  | 
| 
506
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     $YAML::UseVersion = 0;  | 
| 
507
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return YAML::Dump(@_) . "...\n";  | 
| 
508
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
509
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
510
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub at_line_number {  | 
| 
511
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     my ($file_path, $line_number) = (caller(1))[1,2];  | 
| 
512
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     "  at $file_path line $line_number\n";  | 
| 
513
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
514
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
515
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub WWW {  | 
| 
516
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     warn spiffy_dump(@_) . at_line_number;  | 
| 
517
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return wantarray ? @_ : $_[0];  | 
| 
518
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
519
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
520
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub XXX {  | 
| 
521
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     die spiffy_dump(@_) . at_line_number;  | 
| 
522
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
523
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
524
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub YYY {  | 
| 
525
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     print spiffy_dump(@_) . at_line_number;  | 
| 
526
 | 
0
 | 
  
  0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     return wantarray ? @_ : $_[0];  | 
| 
527
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
528
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
529
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub ZZZ {  | 
| 
530
 | 
0
 | 
 
 | 
 
 | 
  
0
  
 | 
  
0
  
 | 
 
 | 
     require Carp;  | 
| 
531
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     Carp::confess spiffy_dump(@_);  | 
| 
532
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
533
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
534
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;  |