Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/Pod/Simple/TiedOutFH.pm |
Statements | Executed 10 statements in 270µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 20µs | 22µs | BEGIN@2 | Pod::Simple::
1 | 1 | 1 | 14µs | 105µs | BEGIN@4 | Pod::Simple::TiedOutFH::
1 | 1 | 1 | 4µs | 44µs | BEGIN@6 | Pod::Simple::TiedOutFH::
1 | 1 | 1 | 3µs | 3µs | BEGIN@5 | Pod::Simple::TiedOutFH::
0 | 0 | 0 | 0s | 0s | CLOSE | Pod::Simple::TiedOutFH::
0 | 0 | 0 | 0s | 0s | FETCH | Pod::Simple::TiedOutFH::
0 | 0 | 0 | 0s | 0s | FILENO | Pod::Simple::TiedOutFH::
0 | 0 | 0 | 0s | 0s | |
0 | 0 | 0 | 0s | 0s | PRINTF | Pod::Simple::TiedOutFH::
0 | 0 | 0 | 0s | 0s | TIEHANDLE | Pod::Simple::TiedOutFH::
0 | 0 | 0 | 0s | 0s | handle_on | Pod::Simple::TiedOutFH::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | |||||
2 | 2 | 42µs | 2 | 24µs | # spent 22µs (20+2) within Pod::Simple::BEGIN@2 which was called:
# once (20µs+2µs) by Pod::Simple::BEGIN@11 at line 2 # spent 22µs making 1 call to Pod::Simple::BEGIN@2
# spent 2µs making 1 call to strict::import |
3 | package Pod::Simple::TiedOutFH; | ||||
4 | 2 | 22µs | 2 | 196µs | # spent 105µs (14+91) within Pod::Simple::TiedOutFH::BEGIN@4 which was called:
# once (14µs+91µs) by Pod::Simple::BEGIN@11 at line 4 # spent 105µs making 1 call to Pod::Simple::TiedOutFH::BEGIN@4
# spent 91µs making 1 call to Exporter::import |
5 | 2 | 12µs | 1 | 3µs | # spent 3µs within Pod::Simple::TiedOutFH::BEGIN@5 which was called:
# once (3µs+0s) by Pod::Simple::BEGIN@11 at line 5 # spent 3µs making 1 call to Pod::Simple::TiedOutFH::BEGIN@5 |
6 | 2 | 191µs | 2 | 84µs | # spent 44µs (4+40) within Pod::Simple::TiedOutFH::BEGIN@6 which was called:
# once (4µs+40µs) by Pod::Simple::BEGIN@11 at line 6 # spent 44µs making 1 call to Pod::Simple::TiedOutFH::BEGIN@6
# spent 40µs making 1 call to vars::import |
7 | 1 | 0s | $VERSION = '3.43'; | ||
8 | |||||
9 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
10 | |||||
11 | sub handle_on { # some horrible frightening things are encapsulated in here | ||||
12 | my $class = shift; | ||||
13 | $class = ref($class) || $class; | ||||
14 | |||||
15 | Carp::croak "Usage: ${class}->handle_on(\$somescalar)" unless @_; | ||||
16 | |||||
17 | my $x = (defined($_[0]) and ref($_[0])) | ||||
18 | ? $_[0] | ||||
19 | : ( \( $_[0] ) )[0] | ||||
20 | ; | ||||
21 | $$x = '' unless defined $$x; | ||||
22 | |||||
23 | #Pod::Simple::DEBUG and print STDERR "New $class handle on $x = \"$$x\"\n"; | ||||
24 | |||||
25 | my $new = gensym(); | ||||
26 | tie *$new, $class, $x; | ||||
27 | return $new; | ||||
28 | } | ||||
29 | |||||
30 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
31 | |||||
32 | sub TIEHANDLE { # Ties to just a scalar ref | ||||
33 | my($class, $scalar_ref) = @_; | ||||
34 | $$scalar_ref = '' unless defined $$scalar_ref; | ||||
35 | return bless \$scalar_ref, ref($class) || $class; | ||||
36 | } | ||||
37 | |||||
38 | sub PRINT { | ||||
39 | my $it = shift; | ||||
40 | foreach my $x (@_) { $$$it .= $x } | ||||
41 | |||||
42 | #Pod::Simple::DEBUG > 10 and print STDERR " appended to $$it = \"$$$it\"\n"; | ||||
43 | |||||
44 | return 1; | ||||
45 | } | ||||
46 | |||||
47 | sub FETCH { | ||||
48 | return ${$_[0]}; | ||||
49 | } | ||||
50 | |||||
51 | sub PRINTF { | ||||
52 | my $it = shift; | ||||
53 | my $format = shift; | ||||
54 | $$$it .= sprintf $format, @_; | ||||
55 | return 1; | ||||
56 | } | ||||
57 | |||||
58 | sub FILENO { ${ $_[0] } + 100 } # just to produce SOME number | ||||
59 | |||||
60 | sub CLOSE { 1 } | ||||
61 | |||||
62 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
63 | 1 | 3µs | 1; | ||
64 | __END__ |