| 1 | package Fake::Our; | ||||||||||
| 2 | ###################################################################### | ||||||||||
| 3 | # | ||||||||||
| 4 | # Fake::Our - Fake 'our' support for perl 5.00503 | ||||||||||
| 5 | # | ||||||||||
| 6 | # http://search.cpan.org/dist/Fake-Our/ | ||||||||||
| 7 | # | ||||||||||
| 8 | # Copyright (c) 2014, 2015, 2017, 2018, 2019, 2023 INABA Hitoshi <ina@cpan.org> in a CPAN | ||||||||||
| 9 | ###################################################################### | ||||||||||
| 10 | |||||||||||
| 11 | 3 | $VERSION = '0.17'; | |||||||||
| 12 | 3 | $VERSION = $VERSION; | |||||||||
| 13 | |||||||||||
| 14 | 3 | ▶ | use 5.00503; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 3 | ▶ | BEGIN { $INC{'warnings.pm'} = '' if $] < 5.006 }; use warnings; $^W=1; | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||
| 17 | |||||||||||
| 18 | 3 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=3 SCAR=12.6
| |||||||||||
| 19 | |||||||||||
| 20 | # provides Fake::Our environment to both perl 5.00503 and 5.006(or later) | ||||||||||
| 21 | 3 | ▶ | if ($^H & 0x00000400) { # is strict qw(vars) enabled? | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 3 | strict::->unimport(qw(vars)); | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 3 | ▶ | if ($] < 5.006) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 3 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | |||||||||||
| 28 | # fake 'our' | ||||||||||
| 29 | 0 | ▶ | *{caller() . '::our'} = sub { @_ }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 30 | # *{caller() . '::our'} = sub : lvalue { @_ }; # perl 5.00503 can't :lvalue | ||||||||||
| 31 | } | ||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 3 | 1; | |||||||||
| 35 | |||||||||||
| 36 | __END__ | ||||||||||