line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 1997-2007 Graham Barr . 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 |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Scalar::Util; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use strict; |
10
|
|
|
|
|
|
|
require Exporter; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
13
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
our $VERSION = "1.42_001"; |
20
|
|
|
|
|
|
|
our $XS_VERSION = $VERSION; |
21
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require XSLoader; |
24
|
|
|
|
|
|
|
XSLoader::load('Scalar::Util', $XS_VERSION); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our @EXPORT_FAIL; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
unless (defined &weaken) { |
29
|
|
|
|
|
|
|
push @EXPORT_FAIL, qw(weaken); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
unless (defined &isweak) { |
32
|
|
|
|
|
|
|
push @EXPORT_FAIL, qw(isweak isvstring); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
unless (defined &isvstring) { |
35
|
|
|
|
|
|
|
push @EXPORT_FAIL, qw(isvstring); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub export_fail { |
39
|
0
|
0
|
|
0
|
0
|
|
if (grep { /^(?:weaken|isweak)$/ } @_ ) { |
|
0
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
require Carp; |
41
|
0
|
|
|
|
|
|
Carp::croak("Weak references are not implemented in the version of perl"); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
if (grep { /^isvstring$/ } @_ ) { |
|
0
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
require Carp; |
46
|
0
|
|
|
|
|
|
Carp::croak("Vstrings are not implemented in the version of perl"); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
@_; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# set_prototype has been moved to Sub::Util with a different interface |
53
|
|
|
|
|
|
|
sub set_prototype(&$) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
1
|
|
my ( $code, $proto ) = @_; |
56
|
0
|
|
|
|
|
|
return Sub::Util::set_prototype( $proto, $code ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |