| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/Tie/ToObject.pm |
| Statements | Executed 14 statements in 782µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 74µs | 92µs | Tie::ToObject::BEGIN@5 |
| 1 | 1 | 1 | 57µs | 209µs | Tie::ToObject::BEGIN@10 |
| 1 | 1 | 1 | 38µs | 166µs | Tie::ToObject::BEGIN@11 |
| 1 | 1 | 1 | 36µs | 213µs | Tie::ToObject::BEGIN@8 |
| 0 | 0 | 0 | 0s | 0s | Tie::ToObject::AUTOLOAD |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | #!/usr/bin/perl | ||||
| 2 | |||||
| 3 | package Tie::ToObject; | ||||
| 4 | |||||
| 5 | 3 | 112µs | 2 | 110µs | # spent 92µs (74+18) within Tie::ToObject::BEGIN@5 which was called:
# once (74µs+18µs) by Data::Visitor::BEGIN@10 at line 5 # spent 92µs making 1 call to Tie::ToObject::BEGIN@5
# spent 18µs making 1 call to strict::import |
| 6 | #use warnings; | ||||
| 7 | |||||
| 8 | 3 | 122µs | 2 | 390µs | # spent 213µs (36+177) within Tie::ToObject::BEGIN@8 which was called:
# once (36µs+177µs) by Data::Visitor::BEGIN@10 at line 8 # spent 213µs making 1 call to Tie::ToObject::BEGIN@8
# spent 177µs making 1 call to vars::import |
| 9 | |||||
| 10 | 3 | 107µs | 2 | 360µs | # spent 209µs (57+151) within Tie::ToObject::BEGIN@10 which was called:
# once (57µs+151µs) by Data::Visitor::BEGIN@10 at line 10 # spent 209µs making 1 call to Tie::ToObject::BEGIN@10
# spent 151µs making 1 call to Exporter::import |
| 11 | 3 | 428µs | 2 | 293µs | # spent 166µs (38+127) within Tie::ToObject::BEGIN@11 which was called:
# once (38µs+127µs) by Data::Visitor::BEGIN@10 at line 11 # spent 166µs making 1 call to Tie::ToObject::BEGIN@11
# spent 127µs making 1 call to Exporter::import |
| 12 | |||||
| 13 | 1 | 3µs | $VERSION = "0.03"; | ||
| 14 | |||||
| 15 | sub AUTOLOAD { | ||||
| 16 | my ( $self, $tied ) = @_; | ||||
| 17 | my ( $method ) = ( $AUTOLOAD =~ /([^:]+)$/ ); | ||||
| 18 | |||||
| 19 | if ( $method =~ /^TIE/ ) { | ||||
| 20 | if ( blessed($tied) ) { | ||||
| 21 | return $tied; | ||||
| 22 | } else { | ||||
| 23 | croak "You must supply an object as the argument to tie()"; | ||||
| 24 | } | ||||
| 25 | } else { | ||||
| 26 | croak "Unsupported method for $method, this module is only for tying to existing objects"; | ||||
| 27 | } | ||||
| 28 | } | ||||
| 29 | |||||
| 30 | 1 | 10µs | __PACKAGE__ | ||
| 31 | |||||
| 32 | __END__ |