File Coverage

blib/lib/Devel/Spy/_overload.pm
Criterion Covered Total %
statement 34 359 9.4
branch 10 466 2.1
condition n/a
subroutine 8 72 11.1
pod 0 3 0.0
total 52 900 5.7


line stmt bran cond sub pod time code
1             #
2             # Devel/Spy/_overload.pm
3             #
4             # Copyright (C) ... by Joshua ben Jore
5             #
6             # You may distribute under the terms of either the GNU General Public
7             # License or the Artistic License, as specified in the README file.
8             #
9             # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
10             # This file is built by overload.PL from its data. Any changes made here
11             # will be lost!
12             #
13              
14             package Devel::Spy::_obj;
15 1     1   7 use strict;
  1         2  
  1         43  
16 1     1   6 use warnings;
  1         3  
  1         12504  
17              
18             require Sub::Name;
19             require overload;
20              
21             sub isa {
22 0     0 0 0 my $self = shift @_;
23              
24 0 0       0 if ( defined Scalar::Util::blessed( $self ) ) {
25 0         0 my $followup = $self->[2]->( '->isa' );
26             # Object method call passed onto our stored thing.
27 0         0 return Devel::Spy->new( $self->[1]->isa( @_ ),
28             $followup );
29             }
30             else {
31             # Class method call on Devel::Spy::_obj. Just forward
32             # to UNIVERSAL or whatever else is there.
33 0         0 return $self->SUPER::isa( @_ );
34             }
35             }
36             sub DOES {
37 0     0 0 0 my $self = shift @_;
38              
39 0 0       0 if ( defined Scalar::Util::blessed( $self ) ) {
40 0         0 my $followup = $self->[2]->( '->DOES' );
41             # Object method call passed onto our stored thing.
42 0         0 return Devel::Spy->new( $self->[1]->DOES( @_ ),
43             $followup );
44             }
45             else {
46             # Class method call on Devel::Spy::_obj. Just forward
47             # to UNIVERSAL or whatever else is there.
48 0         0 return $self->SUPER::DOES( @_ );
49             }
50             }
51             sub can {
52 0     0 0 0 my $self = shift @_;
53              
54 0 0       0 if ( defined Scalar::Util::blessed( $self ) ) {
55 0         0 my $followup = $self->[2]->( '->can' );
56             # Object method call passed onto our stored thing.
57 0         0 return Devel::Spy->new( $self->[1]->can( @_ ),
58             $followup );
59             }
60             else {
61             # Class method call on Devel::Spy::_obj. Just forward
62             # to UNIVERSAL or whatever else is there.
63 0         0 return $self->SUPER::can( @_ );
64             }
65             }
66             my @overloading = (
67             'fallback' => 0,
68             '=' => Sub::Name::subname(
69             '=',
70             sub {
71 0     0   0 my $class = CORE::ref $_[0];
72 0 0       0 my $followup = $_[0][2]->(
73             '->(= '
74             . ( defined $_[0][1]
75             ? $_[0][1]
76             : 'undef' )
77             . ') -> ');
78 0         0 return Devel::Spy->new( $_[0][1], $followup );
79             }
80             ),
81             'atan2' => Sub::Name::subname(
82             'atan2',
83             sub {
84 0     0   0 my ( $result, $followup );
85 0 0       0 if ( $_[2] ) {
86 0         0 $result = atan2 $_[1], $_[0][0];
87 0 0       0 $followup = $_[0][2]->(
    0          
88             ' ->(atan2 '
89             . ( defined $_[1]
90             ? $_[1]
91             : 'undef')
92             . ', '
93             . ( defined $_[0][1]
94             ? $_[0][1]
95             : 'undef')
96             . ') ->'
97             . overload::StrVal($result) );
98             }
99             else {
100 0         0 $result = atan2 $_[0][0], $_[1];
101 0 0       0 $followup = $_[0][2]->(
    0          
102             ' ->(atan2 '
103             . ( defined $_[0][1]
104             ? $_[0][1]
105             : 'undef')
106             . ', '
107             . ( defined $_[1]
108             ? $_[1]
109             : 'undef')
110             . ') ->'
111             . overload::StrVal($result) );
112             }
113 0         0 return Devel::Spy->new( $result, $followup );
114             }
115             ),
116             '-X' => Sub::Name::subname(
117             '-X',
118             sub {
119 0 0   0   0 my $result =
    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          
120             $_[2] eq 'r' ? ( -r $_[0][0] ) :
121             $_[2] eq 'w' ? ( -w $_[0][0] ) :
122             $_[2] eq 'x' ? ( -x $_[0][0] ) :
123             $_[2] eq 'o' ? ( -o $_[0][0] ) :
124             $_[2] eq 'R' ? ( -R $_[0][0] ) :
125             $_[2] eq 'W' ? ( -W $_[0][0] ) :
126             $_[2] eq 'X' ? ( -X $_[0][0] ) :
127             $_[2] eq 'O' ? ( -O $_[0][0] ) :
128             $_[2] eq 'e' ? ( -e $_[0][0] ) :
129             $_[2] eq 'z' ? ( -z $_[0][0] ) :
130             $_[2] eq 's' ? ( -s $_[0][0] ) :
131             $_[2] eq 'f' ? ( -f $_[0][0] ) :
132             $_[2] eq 'd' ? ( -d $_[0][0] ) :
133             $_[2] eq 'l' ? ( -l $_[0][0] ) :
134             $_[2] eq 'p' ? ( -p $_[0][0] ) :
135             $_[2] eq 'S' ? ( -S $_[0][0] ) :
136             $_[2] eq 'b' ? ( -b $_[0][0] ) :
137             $_[2] eq 'c' ? ( -c $_[0][0] ) :
138             $_[2] eq 't' ? ( -t $_[0][0] ) :
139             $_[2] eq 'u' ? ( -u $_[0][0] ) :
140             $_[2] eq 'g' ? ( -g $_[0][0] ) :
141             $_[2] eq 'k' ? ( -k $_[0][0] ) :
142             $_[2] eq 'T' ? ( -T $_[0][0] ) :
143             $_[2] eq 'B' ? ( -B $_[0][0] ) :
144             $_[2] eq 'M' ? ( -M $_[0][0] ) :
145             $_[2] eq 'A' ? ( -A $_[0][0] ) :
146             $_[2] eq 'C' ? ( -C $_[0][0] ) :
147             eval( "-$_[2] $_[0][0]" );
148 0 0       0 my $followup = $_[0][2]->(
149             " ->(-$_[2] "
150             . ( defined $_[0][1]
151             ? $_[0][1]
152             : 'undef' )
153             . ') ->'
154             . overload::StrVal($result) );
155 0         0 return Devel::Spy->new( $result, $followup );
156             }
157             ),
158             '<>' => Sub::Name::subname(
159             '<>',
160             sub {
161 0     0   0 my $result = readline $_[0][0];
162 0 0       0 my $followup = $_[0][2]->(
163             ' ->(readline '
164             . ( defined $_[0][1]
165             ? $_[0][1]
166             : 'undef' )
167             . ') ->'
168             . overload::StrVal($result) );
169 0         0 return Devel::Spy->new( $result, $followup );
170             }
171             ),
172             '${}' => Sub::Name::subname(
173             '${}',
174             sub {
175              
176             # Allow ourselves to access our own guts and let
177             # everyone else have the payload.
178 0 0   0   0 if ( caller() eq 'Devel::Spy::_obj' ) {
179 0         0 return $_[0];
180             }
181             else {
182             # This idea is really dodgy but I found myself in
183             # an infinite loop of some kind when I returned a
184             # plain Devel::Spy object wrapping the
185             # result. Bummer.
186 0         0 my $followup = $_[0][2]->( ' ->${}' );
187 0         0 my $tied = $_[0][0];
188 0         0 my $reftype = CORE::ref( $tied );
189 0 0       0 my $obj =
    0          
    0          
    0          
    0          
190             'HASH' eq $reftype ? ( tied %$tied ) :
191             'ARRAY' eq $reftype ? ( tied @$tied ) :
192             $reftype =~ /
193             ^
194             (?:
195             SCALAR
196             | REF
197             | LVALUE
198             | REGEXP
199             | VSTRING
200             | BIND
201             )
202             \z
203             /x
204             ? ( tied $$tied ) :
205             'CODE' eq $reftype ? ( tied &$tied ) :
206             $reftype =~ /
207             ^
208             (?:
209             GLOB
210             | FORMAT
211             | IO
212             )
213             \z
214             /x
215             ? ( tied *$tied ) :
216             die "Unknown reftype $reftype for object $tied";
217 0         0 $obj->[1] = $followup;
218 0         0 return $tied;
219             }
220             }
221             ),
222             '@{}' => Sub::Name::subname(
223             '@{}',
224             sub {
225              
226             # Allow ourselves to access our own guts and let
227             # everyone else have the payload.
228 39 100   39   161 if ( caller() eq 'Devel::Spy::_obj' ) {
229 38         162 return $_[0];
230             }
231             else {
232             # This idea is really dodgy but I found myself in
233             # an infinite loop of some kind when I returned a
234             # plain Devel::Spy object wrapping the
235             # result. Bummer.
236 1         7 my $followup = $_[0][2]->( ' ->@{}' );
237 1         5 my $tied = $_[0][0];
238 1         6 my $reftype = CORE::ref( $tied );
239 1 0       9 my $obj =
    0          
    0          
    50          
    50          
240             'HASH' eq $reftype ? ( tied %$tied ) :
241             'ARRAY' eq $reftype ? ( tied @$tied ) :
242             $reftype =~ /
243             ^
244             (?:
245             SCALAR
246             | REF
247             | LVALUE
248             | REGEXP
249             | VSTRING
250             | BIND
251             )
252             \z
253             /x
254             ? ( tied $$tied ) :
255             'CODE' eq $reftype ? ( tied &$tied ) :
256             $reftype =~ /
257             ^
258             (?:
259             GLOB
260             | FORMAT
261             | IO
262             )
263             \z
264             /x
265             ? ( tied *$tied ) :
266             die "Unknown reftype $reftype for object $tied";
267 1         8 $obj->[1] = $followup;
268 1         9 return $tied;
269             }
270             }
271             ),
272             '%{}' => Sub::Name::subname(
273             '%{}',
274             sub {
275              
276             # Allow ourselves to access our own guts and let
277             # everyone else have the payload.
278 3 50   3   1717 if ( caller() eq 'Devel::Spy::_obj' ) {
279 0         0 return $_[0];
280             }
281             else {
282             # This idea is really dodgy but I found myself in
283             # an infinite loop of some kind when I returned a
284             # plain Devel::Spy object wrapping the
285             # result. Bummer.
286 3         11 my $followup = $_[0][2]->( ' ->%{}' );
287 3         10 my $tied = $_[0][0];
288 3         9 my $reftype = CORE::ref( $tied );
289 3 0       11 my $obj =
    0          
    0          
    0          
    50          
290             'HASH' eq $reftype ? ( tied %$tied ) :
291             'ARRAY' eq $reftype ? ( tied @$tied ) :
292             $reftype =~ /
293             ^
294             (?:
295             SCALAR
296             | REF
297             | LVALUE
298             | REGEXP
299             | VSTRING
300             | BIND
301             )
302             \z
303             /x
304             ? ( tied $$tied ) :
305             'CODE' eq $reftype ? ( tied &$tied ) :
306             $reftype =~ /
307             ^
308             (?:
309             GLOB
310             | FORMAT
311             | IO
312             )
313             \z
314             /x
315             ? ( tied *$tied ) :
316             die "Unknown reftype $reftype for object $tied";
317 3         6 $obj->[1] = $followup;
318 3         22 return $tied;
319             }
320             }
321             ),
322             '&{}' => Sub::Name::subname(
323             '&{}',
324             sub {
325              
326             # Allow ourselves to access our own guts and let
327             # everyone else have the payload.
328 0 0   0   0 if ( caller() eq 'Devel::Spy::_obj' ) {
329 0         0 return $_[0];
330             }
331             else {
332             # This idea is really dodgy but I found myself in
333             # an infinite loop of some kind when I returned a
334             # plain Devel::Spy object wrapping the
335             # result. Bummer.
336 0         0 my $followup = $_[0][2]->( ' ->&{}' );
337 0         0 my $tied = $_[0][0];
338 0         0 my $reftype = CORE::ref( $tied );
339 0 0       0 my $obj =
    0          
    0          
    0          
    0          
340             'HASH' eq $reftype ? ( tied %$tied ) :
341             'ARRAY' eq $reftype ? ( tied @$tied ) :
342             $reftype =~ /
343             ^
344             (?:
345             SCALAR
346             | REF
347             | LVALUE
348             | REGEXP
349             | VSTRING
350             | BIND
351             )
352             \z
353             /x
354             ? ( tied $$tied ) :
355             'CODE' eq $reftype ? ( tied &$tied ) :
356             $reftype =~ /
357             ^
358             (?:
359             GLOB
360             | FORMAT
361             | IO
362             )
363             \z
364             /x
365             ? ( tied *$tied ) :
366             die "Unknown reftype $reftype for object $tied";
367 0         0 $obj->[1] = $followup;
368 0         0 return $tied;
369             }
370             }
371             ),
372             '*{}' => Sub::Name::subname(
373             '*{}',
374             sub {
375              
376             # Allow ourselves to access our own guts and let
377             # everyone else have the payload.
378 0 0   0   0 if ( caller() eq 'Devel::Spy::_obj' ) {
379 0         0 return $_[0];
380             }
381             else {
382             # This idea is really dodgy but I found myself in
383             # an infinite loop of some kind when I returned a
384             # plain Devel::Spy object wrapping the
385             # result. Bummer.
386 0         0 my $followup = $_[0][2]->( ' ->*{}' );
387 0         0 my $tied = $_[0][0];
388 0         0 my $reftype = CORE::ref( $tied );
389 0 0       0 my $obj =
    0          
    0          
    0          
    0          
390             'HASH' eq $reftype ? ( tied %$tied ) :
391             'ARRAY' eq $reftype ? ( tied @$tied ) :
392             $reftype =~ /
393             ^
394             (?:
395             SCALAR
396             | REF
397             | LVALUE
398             | REGEXP
399             | VSTRING
400             | BIND
401             )
402             \z
403             /x
404             ? ( tied $$tied ) :
405             'CODE' eq $reftype ? ( tied &$tied ) :
406             $reftype =~ /
407             ^
408             (?:
409             GLOB
410             | FORMAT
411             | IO
412             )
413             \z
414             /x
415             ? ( tied *$tied ) :
416             die "Unknown reftype $reftype for object $tied";
417 0         0 $obj->[1] = $followup;
418 0         0 return $tied;
419             }
420             }
421             ),
422             'bool' => Sub::Name::subname(
423             'bool',
424             sub {
425 3     3   68 $_[0][2]->(' ->bool');
426 3         20 return $_[0][0];
427             }
428             ),
429             '""' => Sub::Name::subname(
430             '""',
431             sub {
432 0     0   0 $_[0][2]->(' ->""');
433 0         0 return $_[0][0];
434             }
435             ),
436             '0+' => Sub::Name::subname(
437             '0+',
438             sub {
439 0     0   0 $_[0][2]->(' ->0+');
440 0         0 return $_[0][0];
441             }
442             ),
443             'qr' => Sub::Name::subname(
444             'qr',
445             sub {
446 0     0   0 $_[0][2]->(' ->qr');
447 0         0 return $_[0][0];
448             }
449             ),
450             '+' => Sub::Name::subname(
451             '+',
452             sub {
453 0     0   0 my ( $result, $followup );
454 0 0       0 if ( $_[2] ) {
455 0         0 $result = $_[1] + $_[0][0];
456 0 0       0 $followup = $_[0][2]->(
    0          
457             ' ->('
458             . ( defined $_[1]
459             ? $_[1]
460             : 'undef')
461             . ' + '
462             . ( defined $_[0][1]
463             ? $_[0][1]
464             : 'undef')
465             . ') ->'
466             . overload::StrVal($result) );
467             }
468             else {
469 0         0 $result = $_[0][0] + $_[1];
470 0 0       0 $followup = $_[0][2]->(
    0          
471             ' ->('
472             . ( defined $_[0][1]
473             ? $_[0][1]
474             : 'undef')
475             . ' + '
476             . ( defined $_[1]
477             ? $_[1]
478             : 'undef')
479             . ') ->'
480             . overload::StrVal($result) );
481             }
482 0         0 return Devel::Spy->new( $result, $followup );
483             }
484             ),
485             '-' => Sub::Name::subname(
486             '-',
487             sub {
488 0     0   0 my ( $result, $followup );
489 0 0       0 if ( $_[2] ) {
490 0         0 $result = $_[1] - $_[0][0];
491 0 0       0 $followup = $_[0][2]->(
    0          
492             ' ->('
493             . ( defined $_[1]
494             ? $_[1]
495             : 'undef')
496             . ' - '
497             . ( defined $_[0][1]
498             ? $_[0][1]
499             : 'undef')
500             . ') ->'
501             . overload::StrVal($result) );
502             }
503             else {
504 0         0 $result = $_[0][0] - $_[1];
505 0 0       0 $followup = $_[0][2]->(
    0          
506             ' ->('
507             . ( defined $_[0][1]
508             ? $_[0][1]
509             : 'undef')
510             . ' - '
511             . ( defined $_[1]
512             ? $_[1]
513             : 'undef')
514             . ') ->'
515             . overload::StrVal($result) );
516             }
517 0         0 return Devel::Spy->new( $result, $followup );
518             }
519             ),
520             '*' => Sub::Name::subname(
521             '*',
522             sub {
523 0     0   0 my ( $result, $followup );
524 0 0       0 if ( $_[2] ) {
525 0         0 $result = $_[1] * $_[0][0];
526 0 0       0 $followup = $_[0][2]->(
    0          
527             ' ->('
528             . ( defined $_[1]
529             ? $_[1]
530             : 'undef')
531             . ' * '
532             . ( defined $_[0][1]
533             ? $_[0][1]
534             : 'undef')
535             . ') ->'
536             . overload::StrVal($result) );
537             }
538             else {
539 0         0 $result = $_[0][0] * $_[1];
540 0 0       0 $followup = $_[0][2]->(
    0          
541             ' ->('
542             . ( defined $_[0][1]
543             ? $_[0][1]
544             : 'undef')
545             . ' * '
546             . ( defined $_[1]
547             ? $_[1]
548             : 'undef')
549             . ') ->'
550             . overload::StrVal($result) );
551             }
552 0         0 return Devel::Spy->new( $result, $followup );
553             }
554             ),
555             '/' => Sub::Name::subname(
556             '/',
557             sub {
558 0     0   0 my ( $result, $followup );
559 0 0       0 if ( $_[2] ) {
560 0         0 $result = $_[1] / $_[0][0];
561 0 0       0 $followup = $_[0][2]->(
    0          
562             ' ->('
563             . ( defined $_[1]
564             ? $_[1]
565             : 'undef')
566             . ' / '
567             . ( defined $_[0][1]
568             ? $_[0][1]
569             : 'undef')
570             . ') ->'
571             . overload::StrVal($result) );
572             }
573             else {
574 0         0 $result = $_[0][0] / $_[1];
575 0 0       0 $followup = $_[0][2]->(
    0          
576             ' ->('
577             . ( defined $_[0][1]
578             ? $_[0][1]
579             : 'undef')
580             . ' / '
581             . ( defined $_[1]
582             ? $_[1]
583             : 'undef')
584             . ') ->'
585             . overload::StrVal($result) );
586             }
587 0         0 return Devel::Spy->new( $result, $followup );
588             }
589             ),
590             '%' => Sub::Name::subname(
591             '%',
592             sub {
593 0     0   0 my ( $result, $followup );
594 0 0       0 if ( $_[2] ) {
595 0         0 $result = $_[1] % $_[0][0];
596 0 0       0 $followup = $_[0][2]->(
    0          
597             ' ->('
598             . ( defined $_[1]
599             ? $_[1]
600             : 'undef')
601             . ' % '
602             . ( defined $_[0][1]
603             ? $_[0][1]
604             : 'undef')
605             . ') ->'
606             . overload::StrVal($result) );
607             }
608             else {
609 0         0 $result = $_[0][0] % $_[1];
610 0 0       0 $followup = $_[0][2]->(
    0          
611             ' ->('
612             . ( defined $_[0][1]
613             ? $_[0][1]
614             : 'undef')
615             . ' % '
616             . ( defined $_[1]
617             ? $_[1]
618             : 'undef')
619             . ') ->'
620             . overload::StrVal($result) );
621             }
622 0         0 return Devel::Spy->new( $result, $followup );
623             }
624             ),
625             '**' => Sub::Name::subname(
626             '**',
627             sub {
628 0     0   0 my ( $result, $followup );
629 0 0       0 if ( $_[2] ) {
630 0         0 $result = $_[1] ** $_[0][0];
631 0 0       0 $followup = $_[0][2]->(
    0          
632             ' ->('
633             . ( defined $_[1]
634             ? $_[1]
635             : 'undef')
636             . ' ** '
637             . ( defined $_[0][1]
638             ? $_[0][1]
639             : 'undef')
640             . ') ->'
641             . overload::StrVal($result) );
642             }
643             else {
644 0         0 $result = $_[0][0] ** $_[1];
645 0 0       0 $followup = $_[0][2]->(
    0          
646             ' ->('
647             . ( defined $_[0][1]
648             ? $_[0][1]
649             : 'undef')
650             . ' ** '
651             . ( defined $_[1]
652             ? $_[1]
653             : 'undef')
654             . ') ->'
655             . overload::StrVal($result) );
656             }
657 0         0 return Devel::Spy->new( $result, $followup );
658             }
659             ),
660             '<<' => Sub::Name::subname(
661             '<<',
662             sub {
663 0     0   0 my ( $result, $followup );
664 0 0       0 if ( $_[2] ) {
665 0         0 $result = $_[1] << $_[0][0];
666 0 0       0 $followup = $_[0][2]->(
    0          
667             ' ->('
668             . ( defined $_[1]
669             ? $_[1]
670             : 'undef')
671             . ' << '
672             . ( defined $_[0][1]
673             ? $_[0][1]
674             : 'undef')
675             . ') ->'
676             . overload::StrVal($result) );
677             }
678             else {
679 0         0 $result = $_[0][0] << $_[1];
680 0 0       0 $followup = $_[0][2]->(
    0          
681             ' ->('
682             . ( defined $_[0][1]
683             ? $_[0][1]
684             : 'undef')
685             . ' << '
686             . ( defined $_[1]
687             ? $_[1]
688             : 'undef')
689             . ') ->'
690             . overload::StrVal($result) );
691             }
692 0         0 return Devel::Spy->new( $result, $followup );
693             }
694             ),
695             '>>' => Sub::Name::subname(
696             '>>',
697             sub {
698 0     0   0 my ( $result, $followup );
699 0 0       0 if ( $_[2] ) {
700 0         0 $result = $_[1] >> $_[0][0];
701 0 0       0 $followup = $_[0][2]->(
    0          
702             ' ->('
703             . ( defined $_[1]
704             ? $_[1]
705             : 'undef')
706             . ' >> '
707             . ( defined $_[0][1]
708             ? $_[0][1]
709             : 'undef')
710             . ') ->'
711             . overload::StrVal($result) );
712             }
713             else {
714 0         0 $result = $_[0][0] >> $_[1];
715 0 0       0 $followup = $_[0][2]->(
    0          
716             ' ->('
717             . ( defined $_[0][1]
718             ? $_[0][1]
719             : 'undef')
720             . ' >> '
721             . ( defined $_[1]
722             ? $_[1]
723             : 'undef')
724             . ') ->'
725             . overload::StrVal($result) );
726             }
727 0         0 return Devel::Spy->new( $result, $followup );
728             }
729             ),
730             'x' => Sub::Name::subname(
731             'x',
732             sub {
733 0     0   0 my ( $result, $followup );
734 0 0       0 if ( $_[2] ) {
735 0         0 $result = $_[1] x $_[0][0];
736 0 0       0 $followup = $_[0][2]->(
    0          
737             ' ->('
738             . ( defined $_[1]
739             ? $_[1]
740             : 'undef')
741             . ' x '
742             . ( defined $_[0][1]
743             ? $_[0][1]
744             : 'undef')
745             . ') ->'
746             . overload::StrVal($result) );
747             }
748             else {
749 0         0 $result = $_[0][0] x $_[1];
750 0 0       0 $followup = $_[0][2]->(
    0          
751             ' ->('
752             . ( defined $_[0][1]
753             ? $_[0][1]
754             : 'undef')
755             . ' x '
756             . ( defined $_[1]
757             ? $_[1]
758             : 'undef')
759             . ') ->'
760             . overload::StrVal($result) );
761             }
762 0         0 return Devel::Spy->new( $result, $followup );
763             }
764             ),
765             '.' => Sub::Name::subname(
766             '.',
767             sub {
768 0     0   0 my ( $result, $followup );
769 0 0       0 if ( $_[2] ) {
770 0         0 $result = $_[1] . $_[0][0];
771 0 0       0 $followup = $_[0][2]->(
    0          
772             ' ->('
773             . ( defined $_[1]
774             ? $_[1]
775             : 'undef')
776             . ' . '
777             . ( defined $_[0][1]
778             ? $_[0][1]
779             : 'undef')
780             . ') ->'
781             . overload::StrVal($result) );
782             }
783             else {
784 0         0 $result = $_[0][0] . $_[1];
785 0 0       0 $followup = $_[0][2]->(
    0          
786             ' ->('
787             . ( defined $_[0][1]
788             ? $_[0][1]
789             : 'undef')
790             . ' . '
791             . ( defined $_[1]
792             ? $_[1]
793             : 'undef')
794             . ') ->'
795             . overload::StrVal($result) );
796             }
797 0         0 return Devel::Spy->new( $result, $followup );
798             }
799             ),
800             '<' => Sub::Name::subname(
801             '<',
802             sub {
803 0     0   0 my ( $result, $followup );
804 0 0       0 if ( $_[2] ) {
805 0         0 $result = $_[1] < $_[0][0];
806 0 0       0 $followup = $_[0][2]->(
    0          
807             ' ->('
808             . ( defined $_[1]
809             ? $_[1]
810             : 'undef')
811             . ' < '
812             . ( defined $_[0][1]
813             ? $_[0][1]
814             : 'undef')
815             . ') ->'
816             . overload::StrVal($result) );
817             }
818             else {
819 0         0 $result = $_[0][0] < $_[1];
820 0 0       0 $followup = $_[0][2]->(
    0          
821             ' ->('
822             . ( defined $_[0][1]
823             ? $_[0][1]
824             : 'undef')
825             . ' < '
826             . ( defined $_[1]
827             ? $_[1]
828             : 'undef')
829             . ') ->'
830             . overload::StrVal($result) );
831             }
832 0         0 return Devel::Spy->new( $result, $followup );
833             }
834             ),
835             '<=' => Sub::Name::subname(
836             '<=',
837             sub {
838 0     0   0 my ( $result, $followup );
839 0 0       0 if ( $_[2] ) {
840 0         0 $result = $_[1] <= $_[0][0];
841 0 0       0 $followup = $_[0][2]->(
    0          
842             ' ->('
843             . ( defined $_[1]
844             ? $_[1]
845             : 'undef')
846             . ' <= '
847             . ( defined $_[0][1]
848             ? $_[0][1]
849             : 'undef')
850             . ') ->'
851             . overload::StrVal($result) );
852             }
853             else {
854 0         0 $result = $_[0][0] <= $_[1];
855 0 0       0 $followup = $_[0][2]->(
    0          
856             ' ->('
857             . ( defined $_[0][1]
858             ? $_[0][1]
859             : 'undef')
860             . ' <= '
861             . ( defined $_[1]
862             ? $_[1]
863             : 'undef')
864             . ') ->'
865             . overload::StrVal($result) );
866             }
867 0         0 return Devel::Spy->new( $result, $followup );
868             }
869             ),
870             '>' => Sub::Name::subname(
871             '>',
872             sub {
873 0     0   0 my ( $result, $followup );
874 0 0       0 if ( $_[2] ) {
875 0         0 $result = $_[1] > $_[0][0];
876 0 0       0 $followup = $_[0][2]->(
    0          
877             ' ->('
878             . ( defined $_[1]
879             ? $_[1]
880             : 'undef')
881             . ' > '
882             . ( defined $_[0][1]
883             ? $_[0][1]
884             : 'undef')
885             . ') ->'
886             . overload::StrVal($result) );
887             }
888             else {
889 0         0 $result = $_[0][0] > $_[1];
890 0 0       0 $followup = $_[0][2]->(
    0          
891             ' ->('
892             . ( defined $_[0][1]
893             ? $_[0][1]
894             : 'undef')
895             . ' > '
896             . ( defined $_[1]
897             ? $_[1]
898             : 'undef')
899             . ') ->'
900             . overload::StrVal($result) );
901             }
902 0         0 return Devel::Spy->new( $result, $followup );
903             }
904             ),
905             '>=' => Sub::Name::subname(
906             '>=',
907             sub {
908 0     0   0 my ( $result, $followup );
909 0 0       0 if ( $_[2] ) {
910 0         0 $result = $_[1] >= $_[0][0];
911 0 0       0 $followup = $_[0][2]->(
    0          
912             ' ->('
913             . ( defined $_[1]
914             ? $_[1]
915             : 'undef')
916             . ' >= '
917             . ( defined $_[0][1]
918             ? $_[0][1]
919             : 'undef')
920             . ') ->'
921             . overload::StrVal($result) );
922             }
923             else {
924 0         0 $result = $_[0][0] >= $_[1];
925 0 0       0 $followup = $_[0][2]->(
    0          
926             ' ->('
927             . ( defined $_[0][1]
928             ? $_[0][1]
929             : 'undef')
930             . ' >= '
931             . ( defined $_[1]
932             ? $_[1]
933             : 'undef')
934             . ') ->'
935             . overload::StrVal($result) );
936             }
937 0         0 return Devel::Spy->new( $result, $followup );
938             }
939             ),
940             '==' => Sub::Name::subname(
941             '==',
942             sub {
943 0     0   0 my ( $result, $followup );
944 0 0       0 if ( $_[2] ) {
945 0         0 $result = $_[1] == $_[0][0];
946 0 0       0 $followup = $_[0][2]->(
    0          
947             ' ->('
948             . ( defined $_[1]
949             ? $_[1]
950             : 'undef')
951             . ' == '
952             . ( defined $_[0][1]
953             ? $_[0][1]
954             : 'undef')
955             . ') ->'
956             . overload::StrVal($result) );
957             }
958             else {
959 0         0 $result = $_[0][0] == $_[1];
960 0 0       0 $followup = $_[0][2]->(
    0          
961             ' ->('
962             . ( defined $_[0][1]
963             ? $_[0][1]
964             : 'undef')
965             . ' == '
966             . ( defined $_[1]
967             ? $_[1]
968             : 'undef')
969             . ') ->'
970             . overload::StrVal($result) );
971             }
972 0         0 return Devel::Spy->new( $result, $followup );
973             }
974             ),
975             '!=' => Sub::Name::subname(
976             '!=',
977             sub {
978 0     0   0 my ( $result, $followup );
979 0 0       0 if ( $_[2] ) {
980 0         0 $result = $_[1] != $_[0][0];
981 0 0       0 $followup = $_[0][2]->(
    0          
982             ' ->('
983             . ( defined $_[1]
984             ? $_[1]
985             : 'undef')
986             . ' != '
987             . ( defined $_[0][1]
988             ? $_[0][1]
989             : 'undef')
990             . ') ->'
991             . overload::StrVal($result) );
992             }
993             else {
994 0         0 $result = $_[0][0] != $_[1];
995 0 0       0 $followup = $_[0][2]->(
    0          
996             ' ->('
997             . ( defined $_[0][1]
998             ? $_[0][1]
999             : 'undef')
1000             . ' != '
1001             . ( defined $_[1]
1002             ? $_[1]
1003             : 'undef')
1004             . ') ->'
1005             . overload::StrVal($result) );
1006             }
1007 0         0 return Devel::Spy->new( $result, $followup );
1008             }
1009             ),
1010             '<=>' => Sub::Name::subname(
1011             '<=>',
1012             sub {
1013 0     0   0 my ( $result, $followup );
1014 0 0       0 if ( $_[2] ) {
1015 0         0 $result = $_[1] <=> $_[0][0];
1016 0 0       0 $followup = $_[0][2]->(
    0          
1017             ' ->('
1018             . ( defined $_[1]
1019             ? $_[1]
1020             : 'undef')
1021             . ' <=> '
1022             . ( defined $_[0][1]
1023             ? $_[0][1]
1024             : 'undef')
1025             . ') ->'
1026             . overload::StrVal($result) );
1027             }
1028             else {
1029 0         0 $result = $_[0][0] <=> $_[1];
1030 0 0       0 $followup = $_[0][2]->(
    0          
1031             ' ->('
1032             . ( defined $_[0][1]
1033             ? $_[0][1]
1034             : 'undef')
1035             . ' <=> '
1036             . ( defined $_[1]
1037             ? $_[1]
1038             : 'undef')
1039             . ') ->'
1040             . overload::StrVal($result) );
1041             }
1042 0         0 return Devel::Spy->new( $result, $followup );
1043             }
1044             ),
1045             'cmp' => Sub::Name::subname(
1046             'cmp',
1047             sub {
1048 0     0   0 my ( $result, $followup );
1049 0 0       0 if ( $_[2] ) {
1050 0         0 $result = $_[1] cmp $_[0][0];
1051 0 0       0 $followup = $_[0][2]->(
    0          
1052             ' ->('
1053             . ( defined $_[1]
1054             ? $_[1]
1055             : 'undef')
1056             . ' cmp '
1057             . ( defined $_[0][1]
1058             ? $_[0][1]
1059             : 'undef')
1060             . ') ->'
1061             . overload::StrVal($result) );
1062             }
1063             else {
1064 0         0 $result = $_[0][0] cmp $_[1];
1065 0 0       0 $followup = $_[0][2]->(
    0          
1066             ' ->('
1067             . ( defined $_[0][1]
1068             ? $_[0][1]
1069             : 'undef')
1070             . ' cmp '
1071             . ( defined $_[1]
1072             ? $_[1]
1073             : 'undef')
1074             . ') ->'
1075             . overload::StrVal($result) );
1076             }
1077 0         0 return Devel::Spy->new( $result, $followup );
1078             }
1079             ),
1080             'lt' => Sub::Name::subname(
1081             'lt',
1082             sub {
1083 0     0   0 my ( $result, $followup );
1084 0 0       0 if ( $_[2] ) {
1085 0         0 $result = $_[1] lt $_[0][0];
1086 0 0       0 $followup = $_[0][2]->(
    0          
1087             ' ->('
1088             . ( defined $_[1]
1089             ? $_[1]
1090             : 'undef')
1091             . ' lt '
1092             . ( defined $_[0][1]
1093             ? $_[0][1]
1094             : 'undef')
1095             . ') ->'
1096             . overload::StrVal($result) );
1097             }
1098             else {
1099 0         0 $result = $_[0][0] lt $_[1];
1100 0 0       0 $followup = $_[0][2]->(
    0          
1101             ' ->('
1102             . ( defined $_[0][1]
1103             ? $_[0][1]
1104             : 'undef')
1105             . ' lt '
1106             . ( defined $_[1]
1107             ? $_[1]
1108             : 'undef')
1109             . ') ->'
1110             . overload::StrVal($result) );
1111             }
1112 0         0 return Devel::Spy->new( $result, $followup );
1113             }
1114             ),
1115             'le' => Sub::Name::subname(
1116             'le',
1117             sub {
1118 0     0   0 my ( $result, $followup );
1119 0 0       0 if ( $_[2] ) {
1120 0         0 $result = $_[1] le $_[0][0];
1121 0 0       0 $followup = $_[0][2]->(
    0          
1122             ' ->('
1123             . ( defined $_[1]
1124             ? $_[1]
1125             : 'undef')
1126             . ' le '
1127             . ( defined $_[0][1]
1128             ? $_[0][1]
1129             : 'undef')
1130             . ') ->'
1131             . overload::StrVal($result) );
1132             }
1133             else {
1134 0         0 $result = $_[0][0] le $_[1];
1135 0 0       0 $followup = $_[0][2]->(
    0          
1136             ' ->('
1137             . ( defined $_[0][1]
1138             ? $_[0][1]
1139             : 'undef')
1140             . ' le '
1141             . ( defined $_[1]
1142             ? $_[1]
1143             : 'undef')
1144             . ') ->'
1145             . overload::StrVal($result) );
1146             }
1147 0         0 return Devel::Spy->new( $result, $followup );
1148             }
1149             ),
1150             'gt' => Sub::Name::subname(
1151             'gt',
1152             sub {
1153 0     0   0 my ( $result, $followup );
1154 0 0       0 if ( $_[2] ) {
1155 0         0 $result = $_[1] gt $_[0][0];
1156 0 0       0 $followup = $_[0][2]->(
    0          
1157             ' ->('
1158             . ( defined $_[1]
1159             ? $_[1]
1160             : 'undef')
1161             . ' gt '
1162             . ( defined $_[0][1]
1163             ? $_[0][1]
1164             : 'undef')
1165             . ') ->'
1166             . overload::StrVal($result) );
1167             }
1168             else {
1169 0         0 $result = $_[0][0] gt $_[1];
1170 0 0       0 $followup = $_[0][2]->(
    0          
1171             ' ->('
1172             . ( defined $_[0][1]
1173             ? $_[0][1]
1174             : 'undef')
1175             . ' gt '
1176             . ( defined $_[1]
1177             ? $_[1]
1178             : 'undef')
1179             . ') ->'
1180             . overload::StrVal($result) );
1181             }
1182 0         0 return Devel::Spy->new( $result, $followup );
1183             }
1184             ),
1185             'ge' => Sub::Name::subname(
1186             'ge',
1187             sub {
1188 0     0   0 my ( $result, $followup );
1189 0 0       0 if ( $_[2] ) {
1190 0         0 $result = $_[1] ge $_[0][0];
1191 0 0       0 $followup = $_[0][2]->(
    0          
1192             ' ->('
1193             . ( defined $_[1]
1194             ? $_[1]
1195             : 'undef')
1196             . ' ge '
1197             . ( defined $_[0][1]
1198             ? $_[0][1]
1199             : 'undef')
1200             . ') ->'
1201             . overload::StrVal($result) );
1202             }
1203             else {
1204 0         0 $result = $_[0][0] ge $_[1];
1205 0 0       0 $followup = $_[0][2]->(
    0          
1206             ' ->('
1207             . ( defined $_[0][1]
1208             ? $_[0][1]
1209             : 'undef')
1210             . ' ge '
1211             . ( defined $_[1]
1212             ? $_[1]
1213             : 'undef')
1214             . ') ->'
1215             . overload::StrVal($result) );
1216             }
1217 0         0 return Devel::Spy->new( $result, $followup );
1218             }
1219             ),
1220             'eq' => Sub::Name::subname(
1221             'eq',
1222             sub {
1223 3     3   443 my ( $result, $followup );
1224 3 50       9 if ( $_[2] ) {
1225 0         0 $result = $_[1] eq $_[0][0];
1226 0 0       0 $followup = $_[0][2]->(
    0          
1227             ' ->('
1228             . ( defined $_[1]
1229             ? $_[1]
1230             : 'undef')
1231             . ' eq '
1232             . ( defined $_[0][1]
1233             ? $_[0][1]
1234             : 'undef')
1235             . ') ->'
1236             . overload::StrVal($result) );
1237             }
1238             else {
1239 3         14 $result = $_[0][0] eq $_[1];
1240 3 50       12 $followup = $_[0][2]->(
    50          
1241             ' ->('
1242             . ( defined $_[0][1]
1243             ? $_[0][1]
1244             : 'undef')
1245             . ' eq '
1246             . ( defined $_[1]
1247             ? $_[1]
1248             : 'undef')
1249             . ') ->'
1250             . overload::StrVal($result) );
1251             }
1252 3         25 return Devel::Spy->new( $result, $followup );
1253             }
1254             ),
1255             'ne' => Sub::Name::subname(
1256             'ne',
1257             sub {
1258 0     0   0 my ( $result, $followup );
1259 0 0       0 if ( $_[2] ) {
1260 0         0 $result = $_[1] ne $_[0][0];
1261 0 0       0 $followup = $_[0][2]->(
    0          
1262             ' ->('
1263             . ( defined $_[1]
1264             ? $_[1]
1265             : 'undef')
1266             . ' ne '
1267             . ( defined $_[0][1]
1268             ? $_[0][1]
1269             : 'undef')
1270             . ') ->'
1271             . overload::StrVal($result) );
1272             }
1273             else {
1274 0         0 $result = $_[0][0] ne $_[1];
1275 0 0       0 $followup = $_[0][2]->(
    0          
1276             ' ->('
1277             . ( defined $_[0][1]
1278             ? $_[0][1]
1279             : 'undef')
1280             . ' ne '
1281             . ( defined $_[1]
1282             ? $_[1]
1283             : 'undef')
1284             . ') ->'
1285             . overload::StrVal($result) );
1286             }
1287 0         0 return Devel::Spy->new( $result, $followup );
1288             }
1289             ),
1290             '&' => Sub::Name::subname(
1291             '&',
1292             sub {
1293 0     0   0 my ( $result, $followup );
1294 0 0       0 if ( $_[2] ) {
1295 0         0 $result = $_[1] & $_[0][0];
1296 0 0       0 $followup = $_[0][2]->(
    0          
1297             ' ->('
1298             . ( defined $_[1]
1299             ? $_[1]
1300             : 'undef')
1301             . ' & '
1302             . ( defined $_[0][1]
1303             ? $_[0][1]
1304             : 'undef')
1305             . ') ->'
1306             . overload::StrVal($result) );
1307             }
1308             else {
1309 0         0 $result = $_[0][0] & $_[1];
1310 0 0       0 $followup = $_[0][2]->(
    0          
1311             ' ->('
1312             . ( defined $_[0][1]
1313             ? $_[0][1]
1314             : 'undef')
1315             . ' & '
1316             . ( defined $_[1]
1317             ? $_[1]
1318             : 'undef')
1319             . ') ->'
1320             . overload::StrVal($result) );
1321             }
1322 0         0 return Devel::Spy->new( $result, $followup );
1323             }
1324             ),
1325             '|' => Sub::Name::subname(
1326             '|',
1327             sub {
1328 0     0   0 my ( $result, $followup );
1329 0 0       0 if ( $_[2] ) {
1330 0         0 $result = $_[1] | $_[0][0];
1331 0 0       0 $followup = $_[0][2]->(
    0          
1332             ' ->('
1333             . ( defined $_[1]
1334             ? $_[1]
1335             : 'undef')
1336             . ' | '
1337             . ( defined $_[0][1]
1338             ? $_[0][1]
1339             : 'undef')
1340             . ') ->'
1341             . overload::StrVal($result) );
1342             }
1343             else {
1344 0         0 $result = $_[0][0] | $_[1];
1345 0 0       0 $followup = $_[0][2]->(
    0          
1346             ' ->('
1347             . ( defined $_[0][1]
1348             ? $_[0][1]
1349             : 'undef')
1350             . ' | '
1351             . ( defined $_[1]
1352             ? $_[1]
1353             : 'undef')
1354             . ') ->'
1355             . overload::StrVal($result) );
1356             }
1357 0         0 return Devel::Spy->new( $result, $followup );
1358             }
1359             ),
1360             '^' => Sub::Name::subname(
1361             '^',
1362             sub {
1363 0     0   0 my ( $result, $followup );
1364 0 0       0 if ( $_[2] ) {
1365 0         0 $result = $_[1] ^ $_[0][0];
1366 0 0       0 $followup = $_[0][2]->(
    0          
1367             ' ->('
1368             . ( defined $_[1]
1369             ? $_[1]
1370             : 'undef')
1371             . ' ^ '
1372             . ( defined $_[0][1]
1373             ? $_[0][1]
1374             : 'undef')
1375             . ') ->'
1376             . overload::StrVal($result) );
1377             }
1378             else {
1379 0         0 $result = $_[0][0] ^ $_[1];
1380 0 0       0 $followup = $_[0][2]->(
    0          
1381             ' ->('
1382             . ( defined $_[0][1]
1383             ? $_[0][1]
1384             : 'undef')
1385             . ' ^ '
1386             . ( defined $_[1]
1387             ? $_[1]
1388             : 'undef')
1389             . ') ->'
1390             . overload::StrVal($result) );
1391             }
1392 0         0 return Devel::Spy->new( $result, $followup );
1393             }
1394             ),
1395             '~~' => Sub::Name::subname(
1396             '~~',
1397             sub {
1398 0     0   0 my ( $result, $followup );
1399 0 0       0 if ( $_[2] ) {
1400 0         0 $result = $_[1] ~~ $_[0][0];
1401 0 0       0 $followup = $_[0][2]->(
    0          
1402             ' ->('
1403             . ( defined $_[1]
1404             ? $_[1]
1405             : 'undef')
1406             . ' ~~ '
1407             . ( defined $_[0][1]
1408             ? $_[0][1]
1409             : 'undef')
1410             . ') ->'
1411             . overload::StrVal($result) );
1412             }
1413             else {
1414 0         0 $result = $_[0][0] ~~ $_[1];
1415 0 0       0 $followup = $_[0][2]->(
    0          
1416             ' ->('
1417             . ( defined $_[0][1]
1418             ? $_[0][1]
1419             : 'undef')
1420             . ' ~~ '
1421             . ( defined $_[1]
1422             ? $_[1]
1423             : 'undef')
1424             . ') ->'
1425             . overload::StrVal($result) );
1426             }
1427 0         0 return Devel::Spy->new( $result, $followup );
1428             }
1429             ),
1430             '++' => Sub::Name::subname(
1431             '++',
1432             sub {
1433 0     0   0 my $result = ++ $_[0][0];
1434 0 0       0 my $followup = $_[0][2]->(
1435             ' ->(++ '
1436             . ( defined $_[0][1]
1437             ? $_[0][1]
1438             : 'undef' )
1439             . ') ->'
1440             . overload::StrVal($result) );
1441 0         0 return Devel::Spy->new( $result, $followup );
1442             }
1443             ),
1444             '--' => Sub::Name::subname(
1445             '--',
1446             sub {
1447 0     0   0 my $result = -- $_[0][0];
1448 0 0       0 my $followup = $_[0][2]->(
1449             ' ->(-- '
1450             . ( defined $_[0][1]
1451             ? $_[0][1]
1452             : 'undef' )
1453             . ') ->'
1454             . overload::StrVal($result) );
1455 0         0 return Devel::Spy->new( $result, $followup );
1456             }
1457             ),
1458             '+=' => Sub::Name::subname(
1459             '+=',
1460             sub {
1461 0     0   0 $_[0][0] += $_[1];
1462 0 0       0 my $followup = $_[0][2]->(
1463             '->(+= '
1464             . ( defined $_[1]
1465             ? $_[1]
1466             : 'undef' )
1467             . ') ->'
1468             . overload::StrVal($_[0][1]) );
1469 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1470             }
1471             ),
1472             '-=' => Sub::Name::subname(
1473             '-=',
1474             sub {
1475 0     0   0 $_[0][0] -= $_[1];
1476 0 0       0 my $followup = $_[0][2]->(
1477             '->(-= '
1478             . ( defined $_[1]
1479             ? $_[1]
1480             : 'undef' )
1481             . ') ->'
1482             . overload::StrVal($_[0][1]) );
1483 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1484             }
1485             ),
1486             '*=' => Sub::Name::subname(
1487             '*=',
1488             sub {
1489 0     0   0 $_[0][0] *= $_[1];
1490 0 0       0 my $followup = $_[0][2]->(
1491             '->(*= '
1492             . ( defined $_[1]
1493             ? $_[1]
1494             : 'undef' )
1495             . ') ->'
1496             . overload::StrVal($_[0][1]) );
1497 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1498             }
1499             ),
1500             '/=' => Sub::Name::subname(
1501             '/=',
1502             sub {
1503 0     0   0 $_[0][0] /= $_[1];
1504 0 0       0 my $followup = $_[0][2]->(
1505             '->(/= '
1506             . ( defined $_[1]
1507             ? $_[1]
1508             : 'undef' )
1509             . ') ->'
1510             . overload::StrVal($_[0][1]) );
1511 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1512             }
1513             ),
1514             '%=' => Sub::Name::subname(
1515             '%=',
1516             sub {
1517 0     0   0 $_[0][0] %= $_[1];
1518 0 0       0 my $followup = $_[0][2]->(
1519             '->(%= '
1520             . ( defined $_[1]
1521             ? $_[1]
1522             : 'undef' )
1523             . ') ->'
1524             . overload::StrVal($_[0][1]) );
1525 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1526             }
1527             ),
1528             '**=' => Sub::Name::subname(
1529             '**=',
1530             sub {
1531 0     0   0 $_[0][0] **= $_[1];
1532 0 0       0 my $followup = $_[0][2]->(
1533             '->(**= '
1534             . ( defined $_[1]
1535             ? $_[1]
1536             : 'undef' )
1537             . ') ->'
1538             . overload::StrVal($_[0][1]) );
1539 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1540             }
1541             ),
1542             '<<=' => Sub::Name::subname(
1543             '<<=',
1544             sub {
1545 0     0   0 $_[0][0] <<= $_[1];
1546 0 0       0 my $followup = $_[0][2]->(
1547             '->(<<= '
1548             . ( defined $_[1]
1549             ? $_[1]
1550             : 'undef' )
1551             . ') ->'
1552             . overload::StrVal($_[0][1]) );
1553 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1554             }
1555             ),
1556             '>>=' => Sub::Name::subname(
1557             '>>=',
1558             sub {
1559 0     0   0 $_[0][0] >>= $_[1];
1560 0 0       0 my $followup = $_[0][2]->(
1561             '->(>>= '
1562             . ( defined $_[1]
1563             ? $_[1]
1564             : 'undef' )
1565             . ') ->'
1566             . overload::StrVal($_[0][1]) );
1567 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1568             }
1569             ),
1570             'x=' => Sub::Name::subname(
1571             'x=',
1572             sub {
1573 0     0   0 $_[0][0] x= $_[1];
1574 0 0       0 my $followup = $_[0][2]->(
1575             '->(x= '
1576             . ( defined $_[1]
1577             ? $_[1]
1578             : 'undef' )
1579             . ') ->'
1580             . overload::StrVal($_[0][1]) );
1581 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1582             }
1583             ),
1584             '.=' => Sub::Name::subname(
1585             '.=',
1586             sub {
1587 0     0   0 $_[0][0] .= $_[1];
1588 0 0       0 my $followup = $_[0][2]->(
1589             '->(.= '
1590             . ( defined $_[1]
1591             ? $_[1]
1592             : 'undef' )
1593             . ') ->'
1594             . overload::StrVal($_[0][1]) );
1595 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1596             }
1597             ),
1598             '&=' => Sub::Name::subname(
1599             '&=',
1600             sub {
1601 0     0   0 $_[0][0] &= $_[1];
1602 0 0       0 my $followup = $_[0][2]->(
1603             '->(&= '
1604             . ( defined $_[1]
1605             ? $_[1]
1606             : 'undef' )
1607             . ') ->'
1608             . overload::StrVal($_[0][1]) );
1609 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1610             }
1611             ),
1612             '|=' => Sub::Name::subname(
1613             '|=',
1614             sub {
1615 0     0   0 $_[0][0] |= $_[1];
1616 0 0       0 my $followup = $_[0][2]->(
1617             '->(|= '
1618             . ( defined $_[1]
1619             ? $_[1]
1620             : 'undef' )
1621             . ') ->'
1622             . overload::StrVal($_[0][1]) );
1623 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1624             }
1625             ),
1626             '^=' => Sub::Name::subname(
1627             '^=',
1628             sub {
1629 0     0   0 $_[0][0] ^= $_[1];
1630 0 0       0 my $followup = $_[0][2]->(
1631             '->(^= '
1632             . ( defined $_[1]
1633             ? $_[1]
1634             : 'undef' )
1635             . ') ->'
1636             . overload::StrVal($_[0][1]) );
1637 0         0 $_[0] = Devel::Spy->new( $_[0][1], $followup );
1638             }
1639             ),
1640             'neg' => Sub::Name::subname(
1641             'neg',
1642             sub {
1643 0     0   0 my $result = ! $_[0][0];
1644 0 0       0 my $followup = $_[0][2]->(
1645             " ->(neg"
1646             . ( defined $_[0][1]
1647             ? $_[0][1]
1648             : 'undef')
1649             . ') ->'
1650             . overload::StrVal($result) );
1651 0         0 return Devel::Spy->new( $result, $followup );
1652             }
1653             ),
1654             '!' => Sub::Name::subname(
1655             '!',
1656             sub {
1657 2     2   6 my $result = ! $_[0][0];
1658 2 50       5 my $followup = $_[0][2]->(
1659             " ->(!"
1660             . ( defined $_[0][1]
1661             ? $_[0][1]
1662             : 'undef')
1663             . ') ->'
1664             . overload::StrVal($result) );
1665 2         15 return Devel::Spy->new( $result, $followup );
1666             }
1667             ),
1668             '~' => Sub::Name::subname(
1669             '~',
1670             sub {
1671 0     0     my $result = ~ $_[0][0];
1672 0 0         my $followup = $_[0][2]->(
1673             " ->(~"
1674             . ( defined $_[0][1]
1675             ? $_[0][1]
1676             : 'undef')
1677             . ') ->'
1678             . overload::StrVal($result) );
1679 0           return Devel::Spy->new( $result, $followup );
1680             }
1681             ),
1682             'cos' => Sub::Name::subname(
1683             'cos',
1684             sub {
1685 0     0     my $result = cos $_[0][0];
1686 0 0         my $followup = $_[0][2]->(
1687             " ->(cos"
1688             . ( defined $_[0][1]
1689             ? $_[0][1]
1690             : 'undef')
1691             . ') ->'
1692             . overload::StrVal($result) );
1693 0           return Devel::Spy->new( $result, $followup );
1694             }
1695             ),
1696             'sin' => Sub::Name::subname(
1697             'sin',
1698             sub {
1699 0     0     my $result = sin $_[0][0];
1700 0 0         my $followup = $_[0][2]->(
1701             " ->(sin"
1702             . ( defined $_[0][1]
1703             ? $_[0][1]
1704             : 'undef')
1705             . ') ->'
1706             . overload::StrVal($result) );
1707 0           return Devel::Spy->new( $result, $followup );
1708             }
1709             ),
1710             'exp' => Sub::Name::subname(
1711             'exp',
1712             sub {
1713 0     0     my $result = exp $_[0][0];
1714 0 0         my $followup = $_[0][2]->(
1715             " ->(exp"
1716             . ( defined $_[0][1]
1717             ? $_[0][1]
1718             : 'undef')
1719             . ') ->'
1720             . overload::StrVal($result) );
1721 0           return Devel::Spy->new( $result, $followup );
1722             }
1723             ),
1724             'abs' => Sub::Name::subname(
1725             'abs',
1726             sub {
1727 0     0     my $result = abs $_[0][0];
1728 0 0         my $followup = $_[0][2]->(
1729             " ->(abs"
1730             . ( defined $_[0][1]
1731             ? $_[0][1]
1732             : 'undef')
1733             . ') ->'
1734             . overload::StrVal($result) );
1735 0           return Devel::Spy->new( $result, $followup );
1736             }
1737             ),
1738             'log' => Sub::Name::subname(
1739             'log',
1740             sub {
1741 0     0     my $result = log $_[0][0];
1742 0 0         my $followup = $_[0][2]->(
1743             " ->(log"
1744             . ( defined $_[0][1]
1745             ? $_[0][1]
1746             : 'undef')
1747             . ') ->'
1748             . overload::StrVal($result) );
1749 0           return Devel::Spy->new( $result, $followup );
1750             }
1751             ),
1752             'sqrt' => Sub::Name::subname(
1753             'sqrt',
1754             sub {
1755 0     0     my $result = sqrt $_[0][0];
1756 0 0         my $followup = $_[0][2]->(
1757             " ->(sqrt"
1758             . ( defined $_[0][1]
1759             ? $_[0][1]
1760             : 'undef')
1761             . ') ->'
1762             . overload::StrVal($result) );
1763 0           return Devel::Spy->new( $result, $followup );
1764             }
1765             ),
1766             'int' => Sub::Name::subname(
1767             'int',
1768             sub {
1769 0     0     my $result = int $_[0][0];
1770 0 0         my $followup = $_[0][2]->(
1771             " ->(int"
1772             . ( defined $_[0][1]
1773             ? $_[0][1]
1774             : 'undef')
1775             . ') ->'
1776             . overload::StrVal($result) );
1777 0           return Devel::Spy->new( $result, $followup );
1778             }
1779             ),
1780             );
1781              
1782             overload->import( @overloading );
1783              
1784             # TEST: Verify that all overloadable operations have been overloaded
1785             for my $category ( sort keys %overload::ops ) {
1786             my @ops = split ' ', $overload::ops{$category};
1787             for my $op ( @ops ) {
1788             next if $category eq 'special' && $op eq 'nomethod';
1789             next if $category eq 'special' && $op eq 'fallback';
1790              
1791 1     1   13 no strict 'refs';
  1         3  
  1         168  
1792              
1793             next if defined &{"Devel::Spy::_obj::($op"};
1794              
1795             warn "Missing op [$op] from category [$category]";
1796             }
1797             }
1798              
1799             # Clean up the few things I've generated in this namespace
1800             delete @Devel::Spy::_obj::{qw(
1801             BEGIN
1802             __ANON__
1803             )};
1804              
1805             1;