Filename | C:/tmp64ng/perl/lib/vars.pm |
Statements | Executed 324 statements in 0s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 0s | 0s | BEGIN@3 | vars::
1 | 1 | 1 | 0s | 0s | BEGIN@7 | vars::
1 | 1 | 1 | 0s | 0s | BEGIN@8 | vars::
180 | 3 | 1 | 0s | 0s | CORE:match (opcode) | vars::
19 | 19 | 18 | 0s | 0s | import | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 0s | 1 | 0s | # spent 0s within vars::BEGIN@3 which was called:
# once (0s+0s) by Config::BEGIN@11 at line 3 # spent 0s making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 0s | our $VERSION = '1.03'; | ||
6 | |||||
7 | 2 | 0s | 2 | 0s | # spent 0s within vars::BEGIN@7 which was called:
# once (0s+0s) by Config::BEGIN@11 at line 7 # spent 0s making 1 call to vars::BEGIN@7
# spent 0s making 1 call to warnings::register::import |
8 | 2 | 0s | 2 | 0s | # spent 0s within vars::BEGIN@8 which was called:
# once (0s+0s) by Config::BEGIN@11 at line 8 # spent 0s making 1 call to strict::import
# spent 0s making 1 call to vars::BEGIN@8 |
9 | |||||
10 | # spent 0s within vars::import which was called 19 times, avg 0s/call:
# once (0s+0s) by Win32::API::Struct::BEGIN@11 at line 11 of Win32/API/Struct.pm
# once (0s+0s) by ExtUtils::MakeMaker::version::BEGIN@16 at line 16 of ExtUtils/MakeMaker/version.pm
# once (0s+0s) by Cwd::BEGIN@172 at line 172 of Cwd.pm
# once (0s+0s) by Config::BEGIN@11 at line 11 of Config.pm
# once (0s+0s) by base::BEGIN@4 at line 4 of base.pm
# once (0s+0s) by version::vxs::BEGIN@7 at line 7 of version/vxs.pm
# once (0s+0s) by version::BEGIN@11 at line 11 of version.pm
# once (0s+0s) by Config::BEGIN@7 at line 7 of Config_heavy.pl
# once (0s+0s) by version::regex::BEGIN@5 at line 5 of version/regex.pm
# once (0s+0s) by Win32::API::Type::BEGIN@17 at line 17 of Win32/API/Type.pm
# once (0s+0s) by File::Path::BEGIN@19 at line 19 of File/Path.pm
# once (0s+0s) by Win32::BEGIN@5 at line 5 of Win32.pm
# once (0s+0s) by File::Spec::Win32::BEGIN@5 at line 5 of File/Spec/Win32.pm
# once (0s+0s) by ExtUtils::MM_Unix::BEGIN@17 at line 17 of ExtUtils/MM_Unix.pm
# once (0s+0s) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (0s+0s) by constant::BEGIN@6 at line 6 of constant.pm
# once (0s+0s) by Win32::API::BEGIN@30 at line 30 of Win32/API.pm
# once (0s+0s) by Win32::API::More::BEGIN@397 at line 397 of Win32/API.pm
# once (0s+0s) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm | ||||
11 | 19 | 0s | my $callpack = caller; | ||
12 | 19 | 0s | my (undef, @imports) = @_; | ||
13 | 19 | 0s | my ($sym, $ch); | ||
14 | 19 | 0s | foreach (@imports) { | ||
15 | 60 | 0s | 60 | 0s | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 0s making 60 calls to vars::CORE:match, avg 0s/call |
16 | 60 | 0s | 60 | 0s | if ($sym =~ /\W/) { # spent 0s making 60 calls to vars::CORE:match, avg 0s/call |
17 | # time for a more-detailed check-up | ||||
18 | if ($sym =~ /^\w+[[{].*[]}]$/) { | ||||
19 | require Carp; | ||||
20 | Carp::croak("Can't declare individual elements of hash or array"); | ||||
21 | } elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) { | ||||
22 | warnings::warn("No need to declare built-in vars"); | ||||
23 | } elsif (($^H &= strict::bits('vars'))) { | ||||
24 | require Carp; | ||||
25 | Carp::croak("'$_' is not a valid variable name under strict vars"); | ||||
26 | } | ||||
27 | } | ||||
28 | 60 | 0s | 60 | 0s | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 0s making 60 calls to vars::CORE:match, avg 0s/call |
29 | *$sym = | ||||
30 | ( $ch eq "\$" ? \$$sym | ||||
31 | : $ch eq "\@" ? \@$sym | ||||
32 | : $ch eq "\%" ? \%$sym | ||||
33 | : $ch eq "\*" ? \*$sym | ||||
34 | : $ch eq "\&" ? \&$sym | ||||
35 | 60 | 0s | : do { | ||
36 | require Carp; | ||||
37 | Carp::croak("'$_' is not a valid variable name"); | ||||
38 | }); | ||||
39 | } else { | ||||
40 | require Carp; | ||||
41 | Carp::croak("'$_' is not a valid variable name"); | ||||
42 | } | ||||
43 | } | ||||
44 | }; | ||||
45 | |||||
46 | 1 | 0s | 1; | ||
47 | __END__ | ||||
sub vars::CORE:match; # opcode |