| Filename | /usr/libdata/perl5/amd64-openbsd/Scalar/Util.pm |
| Statements | Executed 13 statements in 846µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 42µs | 48µs | Scalar::Util::BEGIN@9 |
| 6 | 2 | 1 | 29µs | 29µs | Scalar::Util::readonly (xsub) |
| 0 | 0 | 0 | 0s | 0s | Scalar::Util::export_fail |
| 0 | 0 | 0 | 0s | 0s | Scalar::Util::set_prototype |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # Copyright (c) 1997-2007 Graham Barr <gbarr@pobox.com>. All rights reserved. | ||||
| 2 | # This program is free software; you can redistribute it and/or | ||||
| 3 | # modify it under the same terms as Perl itself. | ||||
| 4 | # | ||||
| 5 | # Maintained since 2013 by Paul Evans <leonerd@leonerd.org.uk> | ||||
| 6 | |||||
| 7 | package Scalar::Util; | ||||
| 8 | |||||
| 9 | 2 | 559µs | 2 | 54µs | # spent 48µs (42+6) within Scalar::Util::BEGIN@9 which was called:
# once (42µs+6µs) by IO::Compress::Base::Common::BEGIN@8 at line 9 # spent 48µs making 1 call to Scalar::Util::BEGIN@9
# spent 6µs making 1 call to strict::import |
| 10 | 1 | 2µs | require Exporter; | ||
| 11 | |||||
| 12 | 1 | 18µs | our @ISA = qw(Exporter); | ||
| 13 | 1 | 4µs | our @EXPORT_OK = qw( | ||
| 14 | blessed refaddr reftype weaken unweaken isweak | ||||
| 15 | |||||
| 16 | dualvar isdual isvstring looks_like_number openhandle readonly set_prototype | ||||
| 17 | tainted | ||||
| 18 | ); | ||||
| 19 | 1 | 1µs | our $VERSION = "1.42_02"; | ||
| 20 | 1 | 24µs | $VERSION = eval $VERSION; # spent 6µs executing statements in string eval | ||
| 21 | |||||
| 22 | 1 | 188µs | require List::Util; # List::Util loads the XS | ||
| 23 | 1 | 31µs | 1 | 15µs | List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863) # spent 15µs making 1 call to UNIVERSAL::VERSION |
| 24 | |||||
| 25 | our @EXPORT_FAIL; | ||||
| 26 | |||||
| 27 | 1 | 1µs | unless (defined &weaken) { | ||
| 28 | push @EXPORT_FAIL, qw(weaken); | ||||
| 29 | } | ||||
| 30 | 1 | 1µs | unless (defined &isweak) { | ||
| 31 | push @EXPORT_FAIL, qw(isweak isvstring); | ||||
| 32 | } | ||||
| 33 | 1 | 900ns | unless (defined &isvstring) { | ||
| 34 | push @EXPORT_FAIL, qw(isvstring); | ||||
| 35 | } | ||||
| 36 | |||||
| 37 | sub export_fail { | ||||
| 38 | if (grep { /^(?:weaken|isweak)$/ } @_ ) { | ||||
| 39 | require Carp; | ||||
| 40 | Carp::croak("Weak references are not implemented in the version of perl"); | ||||
| 41 | } | ||||
| 42 | |||||
| 43 | if (grep { /^isvstring$/ } @_ ) { | ||||
| 44 | require Carp; | ||||
| 45 | Carp::croak("Vstrings are not implemented in the version of perl"); | ||||
| 46 | } | ||||
| 47 | |||||
| 48 | @_; | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | # set_prototype has been moved to Sub::Util with a different interface | ||||
| 52 | sub set_prototype(&$) | ||||
| 53 | { | ||||
| 54 | my ( $code, $proto ) = @_; | ||||
| 55 | return Sub::Util::set_prototype( $proto, $code ); | ||||
| 56 | } | ||||
| 57 | |||||
| 58 | 1 | 17µs | 1; | ||
| 59 | |||||
| 60 | __END__ | ||||
# spent 29µs within Scalar::Util::readonly which was called 6 times, avg 5µs/call:
# 4 times (6µs+0s) by IO::Uncompress::Base::read at line 1112 of IO/Uncompress/Base.pm, avg 2µs/call
# 2 times (22µs+0s) by IO::Uncompress::Base::read at line 1105 of IO/Uncompress/Base.pm, avg 11µs/call |