| Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/CPAN/Distrostatus.pm |
| Statements | Executed 4 statements in 121µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 132µs | 132µs | CPAN::Distrostatus::new |
| 0 | 0 | 0 | 0s | 0s | CPAN::Distrostatus::BEGIN |
| 0 | 0 | 0 | 0s | 0s | CPAN::Distrostatus::as_string |
| 0 | 0 | 0 | 0s | 0s | CPAN::Distrostatus::commandid |
| 0 | 0 | 0 | 0s | 0s | CPAN::Distrostatus::failed |
| 0 | 0 | 0 | 0s | 0s | CPAN::Distrostatus::something_has_just_failed |
| 0 | 0 | 0 | 0s | 0s | CPAN::Distrostatus::text |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||||
| 2 | # vim: ts=4 sts=4 sw=4: | ||||
| 3 | package CPAN::Distrostatus; | ||||
| 4 | use overload '""' => "as_string", | ||||
| 5 | fallback => 1; | ||||
| 6 | use vars qw($something_has_failed_at); | ||||
| 7 | use vars qw( | ||||
| 8 | $VERSION | ||||
| 9 | ); | ||||
| 10 | $VERSION = "5.5"; | ||||
| 11 | |||||
| 12 | |||||
| 13 | # spent 132µs within CPAN::Distrostatus::new which was called:
# once (132µs+0s) by CPAN::Distribution::untar_me at line 1204 of CPAN/Distribution.pm | ||||
| 14 | 1 | 22µs | my($class,$arg) = @_; | ||
| 15 | 1 | 43µs | my $failed = substr($arg,0,2) eq "NO"; | ||
| 16 | 1 | 0s | if ($failed) { | ||
| 17 | $something_has_failed_at = $CPAN::CurrentCommandId; | ||||
| 18 | } | ||||
| 19 | bless { | ||||
| 20 | 1 | 56µs | TEXT => $arg, | ||
| 21 | FAILED => $failed, | ||||
| 22 | COMMANDID => $CPAN::CurrentCommandId, | ||||
| 23 | TIME => time, | ||||
| 24 | }, $class; | ||||
| 25 | } | ||||
| 26 | sub something_has_just_failed () { | ||||
| 27 | defined $something_has_failed_at && | ||||
| 28 | $something_has_failed_at == $CPAN::CurrentCommandId; | ||||
| 29 | } | ||||
| 30 | sub commandid { shift->{COMMANDID} } | ||||
| 31 | sub failed { shift->{FAILED} } | ||||
| 32 | sub text { | ||||
| 33 | my($self,$set) = @_; | ||||
| 34 | if (defined $set) { | ||||
| 35 | $self->{TEXT} = $set; | ||||
| 36 | } | ||||
| 37 | $self->{TEXT}; | ||||
| 38 | } | ||||
| 39 | sub as_string { | ||||
| 40 | my($self) = @_; | ||||
| 41 | $self->text; | ||||
| 42 | } | ||||
| 43 | |||||
| 44 | |||||
| 45 | 1; |