| 1 | package mayhaps; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use v5.14; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = 'v0.1.2'; | |||||||||
| 6 | |||||||||||
| 7 | 6 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=2 SCAR=6.9
| |||||||||||
| 8 | 6 | my ($caller, $cond, @args) = @_; | |||||||||
| 9 | 6 | my ($method) = our $AUTOLOAD =~ /^mayhaps::(\w+)$/; | |||||||||
| 10 | 6 | ▶ | return !!$cond ? $caller->$method(@args) : $caller; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | ## ABSTRACT: call methods conditionally for any class or object | ||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 1 | 1; | |||||||||
| 17 | |||||||||||
| 18 | __END__ | ||||||||||