| Filename | /home/hejohns/perl5/lib/perl5/Data/Printer/Filter/Regexp.pm |
| Statements | Executed 10 statements in 186µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 7µs | 8µs | Data::Printer::Filter::Regexp::BEGIN@2 |
| 1 | 1 | 1 | 5µs | 6µs | Data::Printer::Filter::Regexp::BEGIN@5 |
| 1 | 1 | 1 | 3µs | 14µs | Data::Printer::Filter::Regexp::BEGIN@3 |
| 1 | 1 | 1 | 3µs | 15µs | Data::Printer::Filter::Regexp::BEGIN@4 |
| 1 | 1 | 1 | 300ns | 300ns | Data::Printer::Filter::Regexp::__ANON__ (xsub) |
| 0 | 0 | 0 | 0s | 0s | Data::Printer::Filter::Regexp::__ANON__[:30] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Data::Printer::Filter::Regexp; | ||||
| 2 | 2 | 15µs | 2 | 9µs | # spent 8µs (7+1) within Data::Printer::Filter::Regexp::BEGIN@2 which was called:
# once (7µs+1µs) by Data::Printer::Object::BEGIN@59 at line 2 # spent 8µs making 1 call to Data::Printer::Filter::Regexp::BEGIN@2
# spent 1µs making 1 call to strict::import |
| 3 | 2 | 11µs | 2 | 25µs | # spent 14µs (3+11) within Data::Printer::Filter::Regexp::BEGIN@3 which was called:
# once (3µs+11µs) by Data::Printer::Object::BEGIN@59 at line 3 # spent 14µs making 1 call to Data::Printer::Filter::Regexp::BEGIN@3
# spent 11µs making 1 call to warnings::import |
| 4 | 2 | 11µs | 2 | 28µs | # spent 15µs (3+13) within Data::Printer::Filter::Regexp::BEGIN@4 which was called:
# once (3µs+13µs) by Data::Printer::Object::BEGIN@59 at line 4 # spent 15µs making 1 call to Data::Printer::Filter::Regexp::BEGIN@4
# spent 13µs making 1 call to Data::Printer::Filter::import |
| 5 | 2 | 144µs | 2 | 6µs | # spent 6µs (5+300ns) within Data::Printer::Filter::Regexp::BEGIN@5 which was called:
# once (5µs+300ns) by Data::Printer::Object::BEGIN@59 at line 5 # spent 6µs making 1 call to Data::Printer::Filter::Regexp::BEGIN@5
# spent 300ns making 1 call to Data::Printer::Filter::Regexp::__ANON__ |
| 6 | |||||
| 7 | filter 'Regexp' => sub { | ||||
| 8 | my ($regexp, $ddp) = @_; | ||||
| 9 | my $val = "$regexp"; | ||||
| 10 | my $string; | ||||
| 11 | |||||
| 12 | # a regex to parse a regex. Talk about full circle :) | ||||
| 13 | # note: we are not validating anything, just grabbing modifiers | ||||
| 14 | if ($val =~ m/\(\?\^?([uladxismnpogce]*)(?:\-[uladxismnpogce]+)?:(.*)\)/s) { | ||||
| 15 | my ($modifiers, $parsed_val) = ($1, $2); | ||||
| 16 | $string = $ddp->maybe_colorize($parsed_val, 'regex'); | ||||
| 17 | if ($modifiers) { | ||||
| 18 | $string .= " (modifiers: $modifiers)"; | ||||
| 19 | } | ||||
| 20 | } | ||||
| 21 | else { | ||||
| 22 | Data::Printer::Common::_warn($ddp, "Unrecognized regex $val. Please submit a bug report for Data::Printer."); | ||||
| 23 | $string = $ddp->maybe_colorize('Unknown Regexp', 'regex'); | ||||
| 24 | } | ||||
| 25 | |||||
| 26 | if ($ddp->show_tied and my $tie = ref tied $regexp) { | ||||
| 27 | $string .= " (tied to $tie)"; | ||||
| 28 | } | ||||
| 29 | return $string; | ||||
| 30 | 1 | 3µs | 1 | 12µs | }; # spent 12µs making 1 call to Data::Printer::Filter::__ANON__[Data/Printer/Filter.pm:23] |
| 31 | |||||
| 32 | 1 | 2µs | 1; | ||
# spent 300ns within Data::Printer::Filter::Regexp::__ANON__ which was called:
# once (300ns+0s) by Data::Printer::Filter::Regexp::BEGIN@5 at line 5 |