← Index
Performance Profile   « block view • line view • sub view »
For opac/opac-main.pl
  Run on Fri Jul 18 13:58:34 2008
Reported on Fri Jul 18 13:58:42 2008

File/usr/share/perl/5.8/Exporter.pm
Statements Executed119
Total Time0.000274 seconds

Subroutines — ordered by inclusive time then name
CallsInclusive
Time
Subroutine
70.00044Exporter::import
00Exporter::__ANON__[:63]
00Exporter::as_heavy
00Exporter::export
00Exporter::export_fail
00Exporter::export_ok_tags
00Exporter::export_tags
00Exporter::export_to_level
00Exporter::require_version

LineStmts.Exclusive
Time
Avg.Code
1package Exporter;
2
3require 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
9our $Debug = 0;
10our $ExportLevel = 0;
11our $Verbose ||= 0;
12our $VERSION = '5.58';
13our (%Cache);
14$Carp::Internal{Exporter} = 1;
15
16sub as_heavy {
17 require Exporter::Heavy;
18 # Unfortunately, this does not work if the caller is aliased as *name = \&foo
19 # Thus the need to create a lot of identical subroutines
20 my $c = (caller(1))[3];
21 $c =~ s/.*:://;
22 \&{"Exporter::Heavy::heavy_$c"};
23}
24
25sub export {
26 goto &{as_heavy()};
27}
28
29
# spent 0.00044s within Exporter::import which was called 7 times, avg 0.00006s/call: # 1 times (0.00004s) at line 13 of /usr/lib/perl5/YAML/Syck.pm # 1 times (0.00007s) at line 6 of /usr/share/perl5/CGI/Session/Driver/mysql.pm # 1 times (0.00004s) at line 6 of /usr/share/perl5/CGI/Session/ID/md5.pm # 1 times (0.00007s) at line 8 of /usr/share/perl5/CGI/Session/Driver.pm # 1 times (0.00005s) at line 8 of /usr/share/perl5/CGI/Session/Driver/DBI.pm # 1 times (0.00005s) at line 7 of /usr/share/perl5/CGI/Session/Driver/DBI.pm # 1 times (0.00012s) at line 18 of /usr/share/perl/5.8/CGI/Cookie.pm
sub import {
3076e-069e-07 my $pkg = shift;
3178e-061e-06 my $callpkg = caller($ExportLevel);
32
3376e-069e-07 if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
34 *{$callpkg."::import"} = \&import;
35 return;
36 }
37
38 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
3970.000034e-06 my($exports, $fail) = (\@{"$pkg\::EXPORT"}, \@{"$pkg\::EXPORT_FAIL"});
4071e-051e-06 return export $pkg, $callpkg, @_
41 if $Verbose or $Debug or @$fail > 1;
4270.000012e-06 my $export_cache = ($Cache{$pkg} ||= {});
4370.000012e-06 my $args = @_ or @_ = @$exports;
44
4573e-064e-07 local $_;
4676e-069e-07 if ($args and not %$export_cache) {
47 s/^&//, $export_cache->{$_} = 1
48 foreach (@$exports, @{"$pkg\::EXPORT_OK"});
49 }
5071e-061e-07 my $heavy;
51 # Try very hard not to use {} and hence have to enter scope on the foreach
52 # We bomb out of the loop with last as soon as heavy is set.
5377e-061e-06 if ($args or $fail) {
54 ($heavy = (/\W/ or $args and not exists $export_cache->{$_}
55 or @$fail and $_ eq $fail->[0])) and last
56140.000043e-06 foreach (@_);
57 } else {
58 ($heavy = /\W/) and last
59 foreach (@_);
60 }
6171e-061e-07 return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
62 local $SIG{__WARN__} =
6370.000035e-06 sub {require Carp; &Carp::carp};
64 # shortcut for the common case of no type character
65140.000107e-06 *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_;
66}
67
68# Default methods
69
70sub export_fail {
71 my $self = shift;
72 @_;
73}
74
75# Unfortunately, caller(1)[3] "does not work" if the caller is aliased as
76# *name = \&foo. Thus the need to create a lot of identical subroutines
77# Otherwise we could have aliased them to export().
78
79sub export_to_level {
80 goto &{as_heavy()};
81}
82
83sub export_tags {
84 goto &{as_heavy()};
85}
86
87sub export_ok_tags {
88 goto &{as_heavy()};
89}
90
91sub require_version {
92 goto &{as_heavy()};
93}
94
951;
96__END__
97