| Filename | /home/hejohns/perl5/lib/perl5/Data/Printer/Filter/VSTRING.pm |
| Statements | Executed 10 statements in 185µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 10µs | 10µs | Data::Printer::Filter::VSTRING::BEGIN@5 |
| 1 | 1 | 1 | 7µs | 8µs | Data::Printer::Filter::VSTRING::BEGIN@2 |
| 1 | 1 | 1 | 5µs | 16µs | Data::Printer::Filter::VSTRING::BEGIN@3 |
| 1 | 1 | 1 | 3µs | 13µs | Data::Printer::Filter::VSTRING::BEGIN@4 |
| 1 | 1 | 1 | 900ns | 900ns | Data::Printer::Filter::VSTRING::__ANON__ (xsub) |
| 0 | 0 | 0 | 0s | 0s | Data::Printer::Filter::VSTRING::__ANON__[:21] |
| 0 | 0 | 0 | 0s | 0s | Data::Printer::Filter::VSTRING::parse |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Data::Printer::Filter::VSTRING; | ||||
| 2 | 2 | 17µs | 2 | 9µs | # spent 8µs (7+1) within Data::Printer::Filter::VSTRING::BEGIN@2 which was called:
# once (7µs+1µs) by Data::Printer::Object::BEGIN@56 at line 2 # spent 8µs making 1 call to Data::Printer::Filter::VSTRING::BEGIN@2
# spent 1µs making 1 call to strict::import |
| 3 | 2 | 12µs | 2 | 27µs | # spent 16µs (5+11) within Data::Printer::Filter::VSTRING::BEGIN@3 which was called:
# once (5µs+11µs) by Data::Printer::Object::BEGIN@56 at line 3 # spent 16µs making 1 call to Data::Printer::Filter::VSTRING::BEGIN@3
# spent 11µs making 1 call to warnings::import |
| 4 | 2 | 10µs | 2 | 22µs | # spent 13µs (3+10) within Data::Printer::Filter::VSTRING::BEGIN@4 which was called:
# once (3µs+10µs) by Data::Printer::Object::BEGIN@56 at line 4 # spent 13µs making 1 call to Data::Printer::Filter::VSTRING::BEGIN@4
# spent 10µs making 1 call to Data::Printer::Filter::import |
| 5 | 2 | 140µs | 2 | 11µs | # spent 10µs (10+900ns) within Data::Printer::Filter::VSTRING::BEGIN@5 which was called:
# once (10µs+900ns) by Data::Printer::Object::BEGIN@56 at line 5 # spent 10µs making 1 call to Data::Printer::Filter::VSTRING::BEGIN@5
# spent 900ns making 1 call to Data::Printer::Filter::VSTRING::__ANON__ |
| 6 | |||||
| 7 | 1 | 2µs | 1 | 21µs | filter 'VSTRING' => \&parse; # spent 21µs making 1 call to Data::Printer::Filter::__ANON__[Data/Printer/Filter.pm:23] |
| 8 | |||||
| 9 | sub parse { | ||||
| 10 | my ($vstring, $ddp) = @_; | ||||
| 11 | my $string = ''; | ||||
| 12 | |||||
| 13 | # The reason we don't simply do: | ||||
| 14 | # use version 0.77 (); | ||||
| 15 | # is because it was causing some issues with UNIVERSAL on Perl 5.8 and | ||||
| 16 | # some versions of version.pm. So now we do it on runtime on the filter. | ||||
| 17 | # ->parse() will raise an error unless version.pm >= 0.77. | ||||
| 18 | my $error = Data::Printer::Common::_tryme(sub { | ||||
| 19 | require version; | ||||
| 20 | $string = version->parse($$vstring)->normal; | ||||
| 21 | }); | ||||
| 22 | $string = 'VSTRING object (unable to parse)' if $error; | ||||
| 23 | |||||
| 24 | if ($ddp->show_tied and my $tie = ref tied $$vstring) { | ||||
| 25 | $string .= " (tied to $tie)"; | ||||
| 26 | } | ||||
| 27 | return $ddp->maybe_colorize($string, 'vstring'); | ||||
| 28 | }; | ||||
| 29 | |||||
| 30 | 1 | 4µs | 1; | ||
# spent 900ns within Data::Printer::Filter::VSTRING::__ANON__ which was called:
# once (900ns+0s) by Data::Printer::Filter::VSTRING::BEGIN@5 at line 5 |