Filename | /home/mickey/git_tree/PONAPI/Server/lib/PONAPI/Utils/Names.pm |
Statements | Executed 12 statements in 490µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 202µs | 202µs | BEGIN@10 | PONAPI::Utils::Names::
1 | 1 | 1 | 15µs | 29µs | BEGIN@4 | PONAPI::Utils::Names::
1 | 1 | 1 | 8µs | 29µs | BEGIN@7 | PONAPI::Utils::Names::
1 | 1 | 1 | 7µs | 16µs | BEGIN@5 | PONAPI::Utils::Names::
2 | 2 | 1 | 2µs | 2µs | CORE:qr (opcode) | PONAPI::Utils::Names::
0 | 0 | 0 | 0s | 0s | check_name | PONAPI::Utils::Names::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # ABSTRACT: Member names validation utility | ||||
2 | package PONAPI::Utils::Names; | ||||
3 | |||||
4 | 2 | 22µs | 2 | 44µs | # spent 29µs (15+14) within PONAPI::Utils::Names::BEGIN@4 which was called:
# once (15µs+14µs) by PONAPI::Server::BEGIN@18 at line 4 # spent 29µs making 1 call to PONAPI::Utils::Names::BEGIN@4
# spent 14µs making 1 call to strict::import |
5 | 2 | 23µs | 2 | 24µs | # spent 16µs (7+8) within PONAPI::Utils::Names::BEGIN@5 which was called:
# once (7µs+8µs) by PONAPI::Server::BEGIN@18 at line 5 # spent 16µs making 1 call to PONAPI::Utils::Names::BEGIN@5
# spent 8µs making 1 call to warnings::import |
6 | |||||
7 | 2 | 56µs | 2 | 50µs | # spent 29µs (8+21) within PONAPI::Utils::Names::BEGIN@7 which was called:
# once (8µs+21µs) by PONAPI::Server::BEGIN@18 at line 7 # spent 29µs making 1 call to PONAPI::Utils::Names::BEGIN@7
# spent 21µs making 1 call to parent::import |
8 | 1 | 1µs | our @EXPORT_OK = qw< check_name >; | ||
9 | |||||
10 | 3 | 281µs | 3 | 3.17ms | # spent 202µs within PONAPI::Utils::Names::BEGIN@10 which was called:
# once (202µs+0s) by PONAPI::Server::BEGIN@18 at line 10 # spent 2.96ms making 1 call to utf8::AUTOLOAD
# spent 202µs making 1 call to PONAPI::Utils::Names::BEGIN@10
# spent 2µs making 1 call to PONAPI::Utils::Names::CORE:qr |
11 | 1 | 101µs | 2 | 46µs | my $qr_mid = qr/[a-zA-Z0-9\P{ASCII}_\ -]/; # spent 46µs making 1 call to utf8::SWASHNEW
# spent 600ns making 1 call to PONAPI::Utils::Names::CORE:qr |
12 | |||||
13 | sub check_name { | ||||
14 | my $name = shift; | ||||
15 | |||||
16 | return if ref($name); | ||||
17 | return if length($name) == 0; | ||||
18 | |||||
19 | return $name =~ /\A $qr_edge \z/x if length($name) == 1; | ||||
20 | return $name =~ /\A $qr_edge $qr_edge \z/x if length($name) == 2; | ||||
21 | return $name =~ /\A $qr_edge $qr_mid+ $qr_edge \z/x; | ||||
22 | } | ||||
23 | |||||
24 | 1 | 5µs | 1; | ||
25 | |||||
26 | __END__ | ||||
sub PONAPI::Utils::Names::CORE:qr; # opcode |