Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/autodie.pm |
Statements | Executed 17 statements in 472µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 3.94ms | 8.25ms | BEGIN@6 | autodie::
1 | 1 | 1 | 34µs | 34µs | BEGIN@2 | autodie::
1 | 1 | 1 | 16µs | 22µs | BEGIN@3 | autodie::
1 | 1 | 1 | 12µs | 25µs | BEGIN@4 | autodie::
1 | 1 | 1 | 10µs | 74µs | BEGIN@14 | autodie::
1 | 1 | 1 | 7µs | 7µs | import | autodie::
1 | 1 | 1 | 6µs | 6µs | BEGIN@35 | autodie::
1 | 1 | 1 | 5µs | 5µs | BEGIN@10 | autodie::
0 | 0 | 0 | 0s | 0s | unimport | autodie::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package autodie; | ||||
2 | 2 | 39µs | 1 | 34µs | # spent 34µs within autodie::BEGIN@2 which was called:
# once (34µs+0s) by Hailo::BEGIN@4 at line 2 # spent 34µs making 1 call to autodie::BEGIN@2 |
3 | 2 | 26µs | 2 | 27µs | # spent 22µs (16+6) within autodie::BEGIN@3 which was called:
# once (16µs+6µs) by Hailo::BEGIN@4 at line 3 # spent 22µs making 1 call to autodie::BEGIN@3
# spent 6µs making 1 call to strict::import |
4 | 2 | 25µs | 2 | 38µs | # spent 25µs (12+13) within autodie::BEGIN@4 which was called:
# once (12µs+13µs) by Hailo::BEGIN@4 at line 4 # spent 25µs making 1 call to autodie::BEGIN@4
# spent 13µs making 1 call to warnings::import |
5 | |||||
6 | 2 | 179µs | 1 | 8.25ms | # spent 8.25ms (3.94+4.31) within autodie::BEGIN@6 which was called:
# once (3.94ms+4.31ms) by Hailo::BEGIN@4 at line 6 # spent 8.25ms making 1 call to autodie::BEGIN@6 |
7 | 1 | 6µs | our @ISA = qw(Fatal); | ||
8 | 1 | 700ns | our $VERSION; | ||
9 | |||||
10 | # spent 5µs within autodie::BEGIN@10 which was called:
# once (5µs+0s) by Hailo::BEGIN@4 at line 12 | ||||
11 | 1 | 5µs | $VERSION = '2.10'; | ||
12 | 1 | 28µs | 1 | 5µs | } # spent 5µs making 1 call to autodie::BEGIN@10 |
13 | |||||
14 | 1 | 7µs | 1 | 64µs | # spent 74µs (10+64) within autodie::BEGIN@14 which was called:
# once (10µs+64µs) by Hailo::BEGIN@4 at line 29 # spent 64µs making 1 call to constant::import |
15 | Incorrect version of Fatal.pm loaded by autodie. | ||||
16 | |||||
17 | The autodie pragma uses an updated version of Fatal to do its | ||||
18 | heavy lifting. We seem to have loaded Fatal version %s, which is | ||||
19 | probably the version that came with your version of Perl. However | ||||
20 | autodie needs version %s, which would have come bundled with | ||||
21 | autodie. | ||||
22 | |||||
23 | You may be able to solve this problem by adding the following | ||||
24 | line of code to your main program, before any use of Fatal or | ||||
25 | autodie. | ||||
26 | |||||
27 | use lib "%s"; | ||||
28 | |||||
29 | 1 | 70µs | 1 | 74µs | }; # spent 74µs making 1 call to autodie::BEGIN@14 |
30 | |||||
31 | # We have to check we've got the right version of Fatal before we | ||||
32 | # try to compile the rest of our code, lest we use a constant | ||||
33 | # that doesn't exist. | ||||
34 | |||||
35 | # spent 6µs within autodie::BEGIN@35 which was called:
# once (6µs+0s) by Hailo::BEGIN@4 at line 51 | ||||
36 | |||||
37 | # If we have the wrong Fatal, then we've probably loaded the system | ||||
38 | # one, not our own. Complain, and give a useful hint. ;) | ||||
39 | |||||
40 | 1 | 6µs | if ($Fatal::VERSION ne $VERSION) { | ||
41 | my $autodie_path = $INC{'autodie.pm'}; | ||||
42 | |||||
43 | $autodie_path =~ s/autodie\.pm//; | ||||
44 | |||||
45 | require Carp; | ||||
46 | |||||
47 | Carp::croak sprintf( | ||||
48 | ERROR_WRONG_FATAL, $Fatal::VERSION, $VERSION, $autodie_path | ||||
49 | ); | ||||
50 | } | ||||
51 | 1 | 65µs | 1 | 6µs | } # spent 6µs making 1 call to autodie::BEGIN@35 |
52 | |||||
53 | # When passing args to Fatal we want to keep the first arg | ||||
54 | # (our package) in place. Hence the splice. | ||||
55 | |||||
56 | # spent 7µs within autodie::import which was called:
# once (7µs+0s) by Hailo::BEGIN@4 at line 4 of lib/Hailo.pm | ||||
57 | 1 | 2µs | splice(@_,1,0,Fatal::LEXICAL_TAG); | ||
58 | 1 | 9µs | 1 | 2.33ms | goto &Fatal::import; # spent 2.33ms making 1 call to Fatal::import |
59 | } | ||||
60 | |||||
61 | sub unimport { | ||||
62 | splice(@_,1,0,Fatal::LEXICAL_TAG); | ||||
63 | goto &Fatal::unimport; | ||||
64 | } | ||||
65 | |||||
66 | 1 | 4µs | 1; | ||
67 | |||||
68 | __END__ |