« /usr/local/lib/perl5/5.44.0/x86_64-linux/List/Util.pm
↑ Summary
/usr/local/lib/perl5/site_perl/5.44.0/x86_64-linux/Variable/Magic.pm »
| 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 | use strict; | ||
| 10 | use warnings; | ||
| 11 | require Exporter; | ||
| 12 | |||
| 13 | our @ISA = qw(Exporter); | ||
| 14 | our @EXPORT_OK = qw( | ||
| 15 | blessed refaddr reftype weaken unweaken isweak | ||
| 16 | |||
| 17 | dualvar isdual isvstring looks_like_number openhandle readonly set_prototype | ||
| 18 | tainted | ||
| 19 | ); | ||
| 20 | our $VERSION = "1.70"; | ||
| 21 | $VERSION =~ tr/_//d; | ||
| 22 | |||
| 23 | require List::Util; # List::Util loads the XS | ||
| 24 | List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863) | ||
| 25 | |||
| 26 | if( $] >= 5.040 ) { | ||
| 27 | # On Perl 5.40 and above, these builtins are stable, so we can use them | ||
| 28 | # instead of our own XS implementation | ||
| 29 | |||
| 30 | # Using this instead of a globref means we don't create an empty | ||
| 31 | # "builtins::" glob on older perls | ||
| 32 | no strict 'refs'; | ||
| 33 | my $builtins = \%{"builtin::"}; | ||
| 34 | |||
| 35 | *$_ = \&{ $builtins->{$_} } for (qw( blessed refaddr reftype weaken unweaken )); | ||
| 36 | *isweak = \&{ $builtins->{is_weak} }; # renamed | ||
| 37 | } | ||
| 38 | |||
| 39 | # set_prototype has been moved to Sub::Util with a different interface | ||
| 40 | sub set_prototype(&$) | ||
| 41 | { | ||
| 42 | 0 | ▶ | my ( $code, $proto ) = @_; |
|
Subroutine
set_prototype: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 43 | 0 | return Sub::Util::set_prototype( $proto, $code ); | |
| 44 | } | ||
| 45 | |||
| 46 | 1; | ||
| 47 | |||
| 48 | __END__ | ||