File | /usr/local/lib/perl5/5.10.1/strict.pm |
Statements Executed | 747 |
Statement Execution Time | 2.14ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
146 | 144 | 140 | 589µs | 613µs | import | strict::
46 | 46 | 31 | 372µs | 704µs | unimport | strict::
50 | 3 | 1 | 371µs | 371µs | bits | strict::
1 | 1 | 2 | 39µs | 39µs | CORE:regcomp (opcode) | strict::
1 | 1 | 2 | 13µs | 13µs | CORE:match (opcode) | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | 1 | 1µs | $strict::VERSION = "1.04"; | ||
4 | |||||
5 | # Verify that we're called correctly so that strictures will work. | ||||
6 | 1 | 73µs | 2 | 52µs | unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # spent 39µs making 1 call to strict::CORE:regcomp
# spent 13µs making 1 call to strict::CORE:match |
7 | # Can't use Carp, since Carp uses us! | ||||
8 | my (undef, $f, $l) = caller; | ||||
9 | die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n"); | ||||
10 | } | ||||
11 | |||||
12 | 1 | 4µs | my %bitmask = ( | ||
13 | refs => 0x00000002, | ||||
14 | subs => 0x00000200, | ||||
15 | vars => 0x00000400 | ||||
16 | ); | ||||
17 | |||||
18 | sub bits { | ||||
19 | 250 | 340µs | my $bits = 0; | ||
20 | my @wrong; | ||||
21 | foreach my $s (@_) { | ||||
22 | 108 | 126µs | push @wrong, $s unless exists $bitmask{$s}; | ||
23 | $bits |= $bitmask{$s} || 0; | ||||
24 | } | ||||
25 | if (@wrong) { | ||||
26 | require Carp; | ||||
27 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
28 | } | ||||
29 | $bits; | ||||
30 | } | ||||
31 | |||||
32 | 1 | 3µs | 1 | 14µs | my $default_bits = bits(qw(refs subs vars)); # spent 14µs making 1 call to strict::bits |
33 | |||||
34 | # spent 613µs (589+24) within strict::import which was called 146 times, avg 4µs/call:
# 2 times (8µs+0s) by Moose::Exporter::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Exporter.pm:389] at line 344 of Moose/Exporter.pm, avg 4µs/call
# 2 times (4µs+0s) by Moose::Exporter::import at line 566 of Moose/Exporter.pm, avg 2µs/call
# once (7µs+11µs) by base::BEGIN@3 at line 3 of base.pm
# once (7µs+8µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (13µs+0s) by IO::Select::BEGIN@9 at line 9 of IO/Select.pm
# once (6µs+6µs) by Class::Data::Inheritable::BEGIN@3 at line 3 of Class/Data/Inheritable.pm
# once (11µs+0s) by MIME::Base64::BEGIN@3 at line 3 of MIME/Base64.pm
# once (10µs+0s) by Try::Tiny::BEGIN@3 at line 3 of Try/Tiny.pm
# once (10µs+0s) by Moose::Meta::TypeCoercion::BEGIN@4 at line 4 of Moose/Meta/TypeCoercion.pm
# once (9µs+0s) by Class::MOP::Method::BEGIN@4 at line 4 of Class/MOP/Method.pm
# once (9µs+0s) by Class::MOP::Mixin::AttributeCore::BEGIN@3 at line 3 of Class/MOP/Mixin/AttributeCore.pm
# once (9µs+0s) by Moose::Util::MetaRole::BEGIN@3 at line 3 of Moose/Util/MetaRole.pm
# once (9µs+0s) by Params::Util::BEGIN@59 at line 59 of Params/Util.pm
# once (8µs+0s) by LWP::ConnCache::BEGIN@3 at line 3 of LWP/ConnCache.pm
# once (7µs+0s) by Sub::Name::BEGIN@44 at line 44 of Sub/Name.pm
# once (7µs+0s) by HTTP::Message::BEGIN@3 at line 3 of HTTP/Message.pm
# once (7µs+0s) by LWP::Protocol::BEGIN@7 at line 7 of LWP/Protocol.pm
# once (7µs+0s) by Class::MOP::Module::BEGIN@4 at line 4 of Class/MOP/Module.pm
# once (7µs+0s) by LWP::UserAgent::BEGIN@3 at line 3 of LWP/UserAgent.pm
# once (6µs+0s) by Test::More::BEGIN@4 at line 4 of Test/More.pm
# once (6µs+0s) by Data::OptList::BEGIN@3 at line 3 of Data/OptList.pm
# once (6µs+0s) by List::MoreUtils::BEGIN@4 at line 4 of List/MoreUtils.pm
# once (6µs+0s) by Moose::Util::TypeConstraints::OptimizedConstraints::BEGIN@3 at line 3 of Moose/Util/TypeConstraints/OptimizedConstraints.pm
# once (6µs+0s) by Moose::Meta::Role::Composite::BEGIN@3 at line 3 of Moose/Meta/Role/Composite.pm
# once (6µs+0s) by URI::http::BEGIN@6 at line 6 of URI/http.pm
# once (6µs+0s) by Class::MOP::Deprecated::BEGIN@3 at line 3 of Class/MOP/Deprecated.pm
# once (6µs+0s) by Moose::Meta::Mixin::AttributeCore::BEGIN@3 at line 3 of Moose/Meta/Mixin/AttributeCore.pm
# once (6µs+0s) by Devel::StackTrace::BEGIN@5 at line 5 of Devel/StackTrace.pm
# once (5µs+0s) by Class::MOP::Method::Accessor::BEGIN@4 at line 4 of Class/MOP/Method/Accessor.pm
# once (5µs+0s) by Devel::StackTraceFrame::BEGIN@244 at line 244 of Devel/StackTrace.pm
# once (5µs+0s) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm
# once (5µs+0s) by HTTP::Response::BEGIN@7 at line 7 of HTTP/Response.pm
# once (5µs+0s) by LWP::Protocol::http::BEGIN@3 at line 3 of LWP/Protocol/http.pm
# once (5µs+0s) by constant::BEGIN@3 at line 3 of constant.pm
# once (5µs+0s) by Class::MOP::Package::BEGIN@4 at line 4 of Class/MOP/Package.pm
# once (4µs+0s) by Class::MOP::Method::Generated::BEGIN@4 at line 4 of Class/MOP/Method/Generated.pm
# once (4µs+0s) by lib::BEGIN@8 at line 8 of lib.pm
# once (4µs+0s) by Moose::Meta::Method::Destructor::BEGIN@4 at line 4 of Moose/Meta/Method/Destructor.pm
# once (4µs+0s) by Class::MOP::Method::Wrapped::BEGIN@4 at line 4 of Class/MOP/Method/Wrapped.pm
# once (4µs+0s) by Sub::Install::BEGIN@4 at line 4 of Sub/Install.pm
# once (4µs+0s) by Class::MOP::Method::Constructor::BEGIN@4 at line 4 of Class/MOP/Method/Constructor.pm
# once (4µs+0s) by IO::Compress::Base::Common::BEGIN@501 at line 501 of IO/Compress/Base/Common.pm
# once (4µs+0s) by FileHandle::BEGIN@4 at line 4 of FileHandle.pm
# once (4µs+0s) by Moose::Meta::Method::Delegation::BEGIN@4 at line 4 of Moose/Meta/Method/Delegation.pm
# once (4µs+0s) by Moose::Meta::Instance::BEGIN@4 at line 4 of Moose/Meta/Instance.pm
# once (4µs+0s) by IO::Compress::Gzip::Constants::BEGIN@3 at line 3 of IO/Compress/Gzip/Constants.pm
# once (4µs+0s) by IO::Compress::Base::Common::BEGIN@3 at line 3 of IO/Compress/Base/Common.pm
# once (4µs+0s) by IO::Socket::INET::BEGIN@9 at line 9 of IO/Socket/INET.pm
# once (4µs+0s) by Net::HTTP::BEGIN@3 at line 3 of Net/HTTP.pm
# once (4µs+0s) by Class::MOP::Method::Inlined::BEGIN@3 at line 3 of Class/MOP/Method/Inlined.pm
# once (4µs+0s) by IO::Uncompress::Adapter::Inflate::BEGIN@3 at line 3 of IO/Uncompress/Adapter/Inflate.pm
# once (4µs+0s) by Devel::GlobalDestruction::BEGIN@2 at line 2 of Sub/Exporter.pm
# once (4µs+0s) by Test::Builder::Module::BEGIN@3 at line 3 of Test/Builder/Module.pm
# once (4µs+0s) by Errno::BEGIN@9 at line 9 of Errno.pm
# once (4µs+0s) by Moose::Meta::TypeConstraint::BEGIN@4 at line 4 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Class::MOP::Mixin::HasMethods::BEGIN@3 at line 3 of Class/MOP/Mixin/HasMethods.pm
# once (4µs+0s) by Devel::GlobalDestruction::BEGIN@5 at line 5 of Devel/GlobalDestruction.pm
# once (4µs+0s) by Config::BEGIN@9 at line 9 of Config.pm
# once (4µs+0s) by File::Spec::Unix::BEGIN@3 at line 3 of File/Spec/Unix.pm
# once (4µs+0s) by Moose::Meta::Class::Immutable::Trait::BEGIN@3 at line 3 of Moose/Meta/Class/Immutable/Trait.pm
# once (4µs+0s) by HTTP::Request::BEGIN@7 at line 7 of HTTP/Request.pm
# once (3µs+0s) by Class::MOP::Class::Immutable::Trait::BEGIN@3 at line 3 of Class/MOP/Class/Immutable/Trait.pm
# once (3µs+0s) by Class::MOP::Mixin::BEGIN@3 at line 3 of Class/MOP/Mixin.pm
# once (3µs+0s) by Class::MOP::Class::BEGIN@4 at line 4 of Class/MOP/Class.pm
# once (3µs+0s) by Class::MOP::Mixin::HasAttributes::BEGIN@3 at line 3 of Class/MOP/Mixin/HasAttributes.pm
# once (3µs+0s) by Moose::Meta::Role::BEGIN@4 at line 4 of Moose/Meta/Role.pm
# once (3µs+0s) by Moose::BEGIN@2 at line 2 of Moose.pm
# once (3µs+0s) by Moose::Meta::Role::Application::BEGIN@3 at line 3 of Moose/Meta/Role/Application.pm
# once (3µs+0s) by Class::MOP::Attribute::BEGIN@4 at line 4 of Class/MOP/Attribute.pm
# once (3µs+0s) by AutoLoader::BEGIN@3 at line 3 of AutoLoader.pm
# once (3µs+0s) by Moose::Meta::Role::Attribute::BEGIN@3 at line 3 of Moose/Meta/Role/Attribute.pm
# once (3µs+0s) by Moose::Meta::Method::Augmented::BEGIN@3 at line 3 of Moose/Meta/Method/Augmented.pm
# once (3µs+0s) by Moose::Meta::Role::Application::ToClass::BEGIN@3 at line 3 of Moose/Meta/Role/Application/ToClass.pm
# once (3µs+0s) by Test::Builder::BEGIN@4 at line 4 of Test/Builder.pm
# once (3µs+0s) by IO::Uncompress::Gunzip::BEGIN@8 at line 8 of IO/Uncompress/Gunzip.pm
# once (3µs+0s) by SimpleDB::Client::Exception::BEGIN@49 at line 49 of ../lib/SimpleDB/Client/Exception.pm
# once (3µs+0s) by HTTP::Date::BEGIN@11 at line 11 of HTTP/Date.pm
# once (3µs+0s) by IO::Socket::UNIX::BEGIN@9 at line 9 of IO/Socket/UNIX.pm
# once (3µs+0s) by Scalar::Util::BEGIN@9 at line 9 of Scalar/Util.pm
# once (3µs+0s) by Moose::Object::BEGIN@4 at line 4 of Moose/Object.pm
# once (3µs+0s) by re::BEGIN@4 at line 4 of re.pm
# once (3µs+0s) by URI::_idna::BEGIN@6 at line 6 of URI/_idna.pm
# once (3µs+0s) by Digest::base::BEGIN@3 at line 3 of Digest/base.pm
# once (3µs+0s) by Fcntl::BEGIN@58 at line 58 of Fcntl.pm
# once (3µs+0s) by List::Util::BEGIN@11 at line 11 of List/Util.pm
# once (3µs+0s) by Moose::Meta::Method::Constructor::BEGIN@4 at line 4 of Moose/Meta/Method/Constructor.pm
# once (3µs+0s) by URI::BEGIN@3 at line 3 of URI.pm
# once (3µs+0s) by Time::HiRes::BEGIN@3 at line 3 of Time/HiRes.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Role::BEGIN@3 at line 3 of Moose/Meta/TypeConstraint/Role.pm
# once (3µs+0s) by HTTP::Headers::BEGIN@3 at line 3 of HTTP/Headers.pm
# once (3µs+0s) by Net::HTTP::Methods::BEGIN@5 at line 5 of Net/HTTP/Methods.pm
# once (3µs+0s) by URI::_generic::BEGIN@6 at line 6 of URI/_generic.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Class::BEGIN@3 at line 3 of Moose/Meta/TypeConstraint/Class.pm
# once (3µs+0s) by Moose::Meta::Class::BEGIN@4 at line 4 of Moose/Meta/Class.pm
# once (3µs+0s) by URI::_query::BEGIN@3 at line 3 of URI/_query.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Union::BEGIN@4 at line 4 of Moose/Meta/TypeConstraint/Union.pm
# once (3µs+0s) by File::GlobMapper::BEGIN@3 at line 3 of File/GlobMapper.pm
# once (3µs+0s) by Moose::Meta::Method::Overridden::BEGIN@3 at line 3 of Moose/Meta/Method/Overridden.pm
# once (3µs+0s) by IO::Uncompress::RawInflate::BEGIN@4 at line 4 of IO/Uncompress/RawInflate.pm
# once (3µs+0s) by Moose::Meta::Role::Application::ToInstance::BEGIN@3 at line 3 of Moose/Meta/Role/Application/ToInstance.pm
# once (3µs+0s) by Moose::Error::Default::BEGIN@3 at line 3 of Moose/Error/Default.pm
# once (3µs+0s) by URI::_server::BEGIN@5 at line 5 of URI/_server.pm
# once (3µs+0s) by Moose::Meta::Role::Application::ToRole::BEGIN@3 at line 3 of Moose/Meta/Role/Application/ToRole.pm
# once (3µs+0s) by HTTP::Config::BEGIN@3 at line 3 of HTTP/Config.pm
# once (3µs+0s) by Class::MOP::Object::BEGIN@4 at line 4 of Class/MOP/Object.pm
# once (3µs+0s) by Moose::Util::BEGIN@3 at line 3 of Moose/Util.pm
# once (3µs+0s) by IO::Compress::Zlib::Extra::BEGIN@5 at line 5 of IO/Compress/Zlib/Extra.pm
# once (3µs+0s) by File::Spec::BEGIN@3 at line 3 of File/Spec.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::DuckType::BEGIN@3 at line 3 of Moose/Meta/TypeConstraint/DuckType.pm
# once (3µs+0s) by File::Glob::BEGIN@3 at line 3 of File/Glob.pm
# once (3µs+0s) by IO::Uncompress::Base::BEGIN@4 at line 4 of IO/Uncompress/Base.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@3 at line 3 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (3µs+0s) by Moose::Exporter::BEGIN@3 at line 3 of Moose/Exporter.pm
# once (3µs+0s) by Moose::Meta::Attribute::BEGIN@4 at line 4 of Moose/Meta/Attribute.pm
# once (3µs+0s) by Digest::SHA::BEGIN@5 at line 5 of Digest/SHA.pm
# once (3µs+0s) by Moose::Meta::Method::Accessor::BEGIN@4 at line 4 of Moose/Meta/Method/Accessor.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@3 at line 3 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (3µs+0s) by Config::BEGIN@5 at line 5 of Config_heavy.pl
# once (3µs+0s) by mro::BEGIN@10 at line 10 of mro.pm
# once (3µs+0s) by Moose::Meta::Role::Method::BEGIN@4 at line 4 of Moose/Meta/Role/Method.pm
# once (3µs+0s) by URI::Escape::BEGIN@2 at line 2 of URI/Escape.pm
# once (3µs+0s) by Moose::Meta::Role::Method::Conflicting::BEGIN@4 at line 4 of Moose/Meta/Role/Method/Conflicting.pm
# once (3µs+0s) by HTTP::Status::BEGIN@3 at line 3 of HTTP/Status.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Registry::BEGIN@4 at line 4 of Moose/Meta/TypeConstraint/Registry.pm
# once (3µs+0s) by Moose::Meta::TypeCoercion::Union::BEGIN@4 at line 4 of Moose/Meta/TypeCoercion/Union.pm
# once (3µs+0s) by IO::Seekable::BEGIN@99 at line 99 of IO/Seekable.pm
# once (3µs+0s) by IO::File::BEGIN@128 at line 128 of IO/File.pm
# once (3µs+0s) by Moose::Meta::TypeConstraint::Enum::BEGIN@3 at line 3 of Moose/Meta/TypeConstraint/Enum.pm
# once (3µs+0s) by Class::MOP::BEGIN@4 at line 4 of Class/MOP.pm
# once (3µs+0s) by Moose::Meta::Role::Application::RoleSummation::BEGIN@3 at line 3 of Moose/Meta/Role/Application/RoleSummation.pm
# once (3µs+0s) by metaclass::BEGIN@4 at line 4 of metaclass.pm
# once (3µs+0s) by Moose::Meta::Role::Method::Required::BEGIN@4 at line 4 of Moose/Meta/Role/Method/Required.pm
# once (3µs+0s) by Moose::Meta::Method::BEGIN@3 at line 3 of Moose/Meta/Method.pm
# once (3µs+0s) by MRO::Compat::BEGIN@2 at line 2 of MRO/Compat.pm
# once (3µs+0s) by URI::_punycode::BEGIN@3 at line 3 of URI/_punycode.pm
# once (3µs+0s) by Class::MOP::Instance::BEGIN@4 at line 4 of Class/MOP/Instance.pm
# once (2µs+0s) by IO::Handle::BEGIN@261 at line 261 of IO/Handle.pm
# once (2µs+0s) by Exception::Class::BEGIN@5 at line 5 of Exception/Class.pm
# once (2µs+0s) by XML::Bare::BEGIN@4 at line 4 of XML/Bare.pm
# once (2µs+0s) by Time::Local::BEGIN@6 at line 6 of Time/Local.pm
# once (2µs+0s) by Exception::Class::Base::BEGIN@3 at line 3 of Exception/Class/Base.pm
# once (2µs+0s) by IO::Socket::BEGIN@14 at line 14 of IO/Socket.pm
# once (2µs+0s) by Compress::Raw::Zlib::BEGIN@11 at line 11 of Compress/Raw/Zlib.pm
# once (2µs+0s) by IO::BEGIN@7 at line 7 of IO.pm | ||||
35 | 292 | 1.21ms | shift; | ||
36 | $^H |= @_ ? bits(@_) : $default_bits; # spent 24µs making 3 calls to strict::bits, avg 8µs/call | ||||
37 | } | ||||
38 | |||||
39 | # spent 704µs (372+332) within strict::unimport which was called 46 times, avg 15µs/call:
# once (9µs+17µs) by Exception::Class::Base::BEGIN@43 at line 43 of Exception/Class/Base.pm
# once (12µs+13µs) by LWP::Protocol::BEGIN@62 at line 62 of LWP/Protocol.pm
# once (13µs+12µs) by Sub::Install::BEGIN@184 at line 184 of Sub/Install.pm
# once (11µs+11µs) by Errno::BEGIN@162 at line 162 of Errno.pm
# once (14µs+8µs) by Config::BEGIN@35 at line 35 of Config.pm
# once (10µs+11µs) by constant::BEGIN@38 at line 38 of constant.pm
# once (11µs+10µs) by Moose::Meta::Role::BEGIN@559 at line 559 of Moose/Meta/Role.pm
# once (10µs+10µs) by Class::MOP::Package::BEGIN@100 at line 100 of Class/MOP/Package.pm
# once (10µs+10µs) by HTTP::Message::BEGIN@621 at line 621 of HTTP/Message.pm
# once (10µs+9µs) by Moose::Object::BEGIN@80 at line 80 of Moose/Object.pm
# once (10µs+9µs) by URI::BEGIN@127 at line 127 of URI.pm
# once (9µs+9µs) by Moose::Util::TypeConstraints::BEGIN@65 at line 65 of Moose/Util/TypeConstraints.pm
# once (9µs+9µs) by Moose::Exporter::BEGIN@206 at line 206 of Moose/Exporter.pm
# once (9µs+9µs) by Class::MOP::Class::Immutable::Trait::BEGIN@36 at line 36 of Class/MOP/Class/Immutable/Trait.pm
# once (9µs+8µs) by Compress::Raw::Zlib::BEGIN@78 at line 78 of Compress/Raw/Zlib.pm
# once (9µs+8µs) by AutoLoader::BEGIN@30 at line 30 of AutoLoader.pm
# once (9µs+8µs) by Exception::Class::BEGIN@45 at line 45 of Exception/Class.pm
# once (9µs+8µs) by Devel::StackTraceFrame::BEGIN@252 at line 252 of Devel/StackTrace.pm
# once (9µs+7µs) by Exception::Class::Base::BEGIN@65 at line 65 of Exception/Class/Base.pm
# once (9µs+7µs) by Exception::Class::BEGIN@78 at line 78 of Exception/Class.pm
# once (7µs+8µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
# once (8µs+7µs) by Exception::Class::BEGIN@168 at line 168 of Exception/Class.pm
# once (8µs+6µs) by constant::BEGIN@101 at line 101 of constant.pm
# once (8µs+7µs) by IO::Handle::BEGIN@613 at line 613 of IO/Handle.pm
# once (9µs+5µs) by Test::Builder::BEGIN@1540 at line 1540 of Test/Builder.pm
# once (7µs+7µs) by FileHandle::BEGIN@46 at line 46 of FileHandle.pm
# once (7µs+6µs) by Net::HTTP::Methods::BEGIN@98 at line 98 of Net/HTTP/Methods.pm
# once (7µs+6µs) by Class::MOP::Module::BEGIN@64 at line 64 of Class/MOP/Module.pm
# once (7µs+6µs) by Class::MOP::Package::BEGIN@207 at line 207 of Class/MOP/Package.pm
# once (7µs+5µs) by Carp::BEGIN@300 at line 300 of Carp/Heavy.pm
# once (7µs+5µs) by Class::MOP::Package::BEGIN@145 at line 145 of Class/MOP/Package.pm
# once (7µs+5µs) by Test::Builder::BEGIN@2107 at line 2107 of Test/Builder.pm
# once (6µs+5µs) by LWP::UserAgent::BEGIN@353 at line 353 of LWP/UserAgent.pm
# once (6µs+5µs) by Class::MOP::Package::BEGIN@152 at line 152 of Class/MOP/Package.pm
# once (6µs+5µs) by Fcntl::BEGIN@239 at line 239 of Fcntl.pm
# once (6µs+5µs) by AutoLoader::BEGIN@186 at line 186 of AutoLoader.pm
# once (6µs+5µs) by Time::HiRes::BEGIN@42 at line 42 of Time/HiRes.pm
# once (6µs+5µs) by File::Spec::Unix::BEGIN@149 at line 149 of File/Spec/Unix.pm
# once (6µs+5µs) by Moose::Exporter::BEGIN@488 at line 488 of Moose/Exporter.pm
# once (6µs+5µs) by AutoLoader::BEGIN@138 at line 138 of AutoLoader.pm
# once (6µs+5µs) by Moose::Exporter::BEGIN@385 at line 385 of Moose/Exporter.pm
# once (6µs+5µs) by MRO::Compat::BEGIN@116 at line 116 of MRO/Compat.pm
# once (6µs+5µs) by MRO::Compat::BEGIN@256 at line 256 of MRO/Compat.pm
# once (6µs+4µs) by MRO::Compat::BEGIN@225 at line 225 of MRO/Compat.pm
# once (6µs+5µs) by Class::MOP::Class::BEGIN@257 at line 257 of Class/MOP/Class.pm
# once (5µs+4µs) by Moose::Exporter::BEGIN@498 at line 498 of Moose/Exporter.pm | ||||
40 | 92 | 354µs | shift; | ||
41 | $^H &= ~ (@_ ? bits(@_) : $default_bits); # spent 332µs making 46 calls to strict::bits, avg 7µs/call | ||||
42 | } | ||||
43 | |||||
44 | 1 | 29µs | 1; | ||
45 | __END__ | ||||
46 | |||||
47 | =head1 NAME | ||||
48 | |||||
49 | strict - Perl pragma to restrict unsafe constructs | ||||
50 | |||||
51 | =head1 SYNOPSIS | ||||
52 | |||||
53 | use strict; | ||||
54 | |||||
55 | use strict "vars"; | ||||
56 | use strict "refs"; | ||||
57 | use strict "subs"; | ||||
58 | |||||
59 | use strict; | ||||
60 | no strict "vars"; | ||||
61 | |||||
62 | =head1 DESCRIPTION | ||||
63 | |||||
64 | If no import list is supplied, all possible restrictions are assumed. | ||||
65 | (This is the safest mode to operate in, but is sometimes too strict for | ||||
66 | casual programming.) Currently, there are three possible things to be | ||||
67 | strict about: "subs", "vars", and "refs". | ||||
68 | |||||
69 | =over 6 | ||||
70 | |||||
71 | =item C<strict refs> | ||||
72 | |||||
73 | This generates a runtime error if you | ||||
74 | use symbolic references (see L<perlref>). | ||||
75 | |||||
76 | use strict 'refs'; | ||||
77 | $ref = \$foo; | ||||
78 | print $$ref; # ok | ||||
79 | $ref = "foo"; | ||||
80 | print $$ref; # runtime error; normally ok | ||||
81 | $file = "STDOUT"; | ||||
82 | print $file "Hi!"; # error; note: no comma after $file | ||||
83 | |||||
84 | There is one exception to this rule: | ||||
85 | |||||
86 | $bar = \&{'foo'}; | ||||
87 | &$bar; | ||||
88 | |||||
89 | is allowed so that C<goto &$AUTOLOAD> would not break under stricture. | ||||
90 | |||||
91 | |||||
92 | =item C<strict vars> | ||||
93 | |||||
94 | This generates a compile-time error if you access a variable that wasn't | ||||
95 | declared via C<our> or C<use vars>, | ||||
96 | localized via C<my()>, or wasn't fully qualified. Because this is to avoid | ||||
97 | variable suicide problems and subtle dynamic scoping issues, a merely | ||||
98 | local() variable isn't good enough. See L<perlfunc/my> and | ||||
99 | L<perlfunc/local>. | ||||
100 | |||||
101 | use strict 'vars'; | ||||
102 | $X::foo = 1; # ok, fully qualified | ||||
103 | my $foo = 10; # ok, my() var | ||||
104 | local $foo = 9; # blows up | ||||
105 | |||||
106 | package Cinna; | ||||
107 | our $bar; # Declares $bar in current package | ||||
108 | $bar = 'HgS'; # ok, global declared via pragma | ||||
109 | |||||
110 | The local() generated a compile-time error because you just touched a global | ||||
111 | name without fully qualifying it. | ||||
112 | |||||
113 | Because of their special use by sort(), the variables $a and $b are | ||||
114 | exempted from this check. | ||||
115 | |||||
116 | =item C<strict subs> | ||||
117 | |||||
118 | This disables the poetry optimization, generating a compile-time error if | ||||
119 | you try to use a bareword identifier that's not a subroutine, unless it | ||||
120 | is a simple identifier (no colons) and that it appears in curly braces or | ||||
121 | on the left hand side of the C<< => >> symbol. | ||||
122 | |||||
123 | use strict 'subs'; | ||||
124 | $SIG{PIPE} = Plumber; # blows up | ||||
125 | $SIG{PIPE} = "Plumber"; # just fine: quoted string is always ok | ||||
126 | $SIG{PIPE} = \&Plumber; # preferred form | ||||
127 | |||||
128 | =back | ||||
129 | |||||
130 | See L<perlmodlib/Pragmatic Modules>. | ||||
131 | |||||
132 | =head1 HISTORY | ||||
133 | |||||
134 | C<strict 'subs'>, with Perl 5.6.1, erroneously permitted to use an unquoted | ||||
135 | compound identifier (e.g. C<Foo::Bar>) as a hash key (before C<< => >> or | ||||
136 | inside curlies), but without forcing it always to a literal string. | ||||
137 | |||||
138 | Starting with Perl 5.8.1 strict is strict about its restrictions: | ||||
139 | if unknown restrictions are used, the strict pragma will abort with | ||||
140 | |||||
141 | Unknown 'strict' tag(s) '...' | ||||
142 | |||||
143 | As of version 1.04 (Perl 5.10), strict verifies that it is used as | ||||
144 | "strict" to avoid the dreaded Strict trap on case insensitive file | ||||
145 | systems. | ||||
146 | |||||
147 | =cut | ||||
# spent 13µs within strict::CORE:match which was called
# once (13µs+0s) by Test::More::BEGIN@4 at line 6 of strict.pm | |||||
# spent 39µs within strict::CORE:regcomp which was called
# once (39µs+0s) by Test::More::BEGIN@4 at line 6 of strict.pm |