← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:01:02 2013

Filename/usr/lib/perl/5.10/Scalar/Util.pm
StatementsExecuted 14 statements in 604µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
4152286µs286µsScalar::Util::::blessedScalar::Util::blessed (xsub)
11123µs29µsScalar::Util::::BEGIN@9Scalar::Util::BEGIN@9
11113µs104µsScalar::Util::::BEGIN@10Scalar::Util::BEGIN@10
1118µs8µsScalar::Util::::weakenScalar::Util::weaken (xsub)
0000s0sScalar::Util::::export_failScalar::Util::export_fail
0000s0sScalar::Util::::openhandleScalar::Util::openhandle
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Scalar::Util.pm
2#
3# Copyright (c) 1997-2007 Graham Barr <gbarr@pobox.com>. All rights reserved.
4# This program is free software; you can redistribute it and/or
5# modify it under the same terms as Perl itself.
6
7package Scalar::Util;
8
9352µs235µs
# spent 29µs (23+6) within Scalar::Util::BEGIN@9 which was called: # once (23µs+6µs) by C4::Context::BEGIN@101 at line 9
use strict;
# spent 29µs making 1 call to Scalar::Util::BEGIN@9 # spent 6µs making 1 call to strict::import
103420µs2194µs
# spent 104µs (13+91) within Scalar::Util::BEGIN@10 which was called: # once (13µs+91µs) by C4::Context::BEGIN@101 at line 10
use vars qw(@ISA @EXPORT_OK $VERSION @EXPORT_FAIL);
# spent 104µs making 1 call to Scalar::Util::BEGIN@10 # spent 91µs making 1 call to vars::import
1111µsrequire Exporter;
12189µsrequire List::Util; # List::Util loads the XS
13
1419µs@ISA = qw(Exporter);
1513µs@EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle refaddr isvstring looks_like_number set_prototype);
161500ns$VERSION = "1.21";
17120µs$VERSION = eval $VERSION;
# spent 3µs executing statements in string eval
18
191500nsunless (defined &dualvar) {
20 # Load Pure Perl version if XS not loaded
21 require Scalar::Util::PP;
22 Scalar::Util::PP->import;
23 push @EXPORT_FAIL, qw(weaken isweak dualvar isvstring set_prototype);
24}
25
26sub export_fail {
27 if (grep { /dualvar/ } @EXPORT_FAIL) { # no XS loaded
28 my $pat = join("|", @EXPORT_FAIL);
29 if (my ($err) = grep { /^($pat)$/ } @_ ) {
30 require Carp;
31 Carp::croak("$err is only available with the XS version of Scalar::Util");
32 }
33 }
34
35 if (grep { /^(weaken|isweak)$/ } @_ ) {
36 require Carp;
37 Carp::croak("Weak references are not implemented in the version of perl");
38 }
39
40 if (grep { /^(isvstring)$/ } @_ ) {
41 require Carp;
42 Carp::croak("Vstrings are not implemented in the version of perl");
43 }
44
45 @_;
46}
47
48sub openhandle ($) {
49 my $fh = shift;
50 my $rt = reftype($fh) || '';
51
52 return defined(fileno($fh)) ? $fh : undef
53 if $rt eq 'IO';
54
55 if (reftype(\$fh) eq 'GLOB') { # handle openhandle(*DATA)
56 $fh = \(my $tmp=$fh);
57 }
58 elsif ($rt ne 'GLOB') {
59 return undef;
60 }
61
62 (tied(*$fh) or defined(fileno($fh)))
63 ? $fh : undef;
64}
65
6619µs1;
67
68__END__
 
# spent 286µs within Scalar::Util::blessed which was called 41 times, avg 7µs/call: # 12 times (35µs+0s) by Template::Iterator::new at line 55 of Template/Iterator.pm, avg 3µs/call # 10 times (57µs+0s) by Template::Context::template at line 87 of Template/Context.pm, avg 6µs/call # 9 times (103µs+0s) by Template::Context::process at line 331 of Template/Context.pm, avg 11µs/call # 9 times (90µs+0s) by Template::Context::process at line 373 of Template/Context.pm, avg 10µs/call # once (1µs+0s) by Template::Context::process at line 339 of Template/Context.pm
sub Scalar::Util::blessed; # xsub
# spent 8µs within Scalar::Util::weaken which was called: # once (8µs+0s) by C4::Context::BEGIN@101 at line 289 of DBI.pm
sub Scalar::Util::weaken; # xsub