Attribute-GlobalEnable
view release on metacpan or search on metacpan
lib/Attribute/GlobalEnable.pm view on Meta::CPAN
## $DONE_INIT).
##
## this should return true if it is successfull... it should bail otherwise.
sub import {
return _export_my_attribute_symbols() if $DONE_INIT;
my $class = shift();
croak "Must specify some arguments." if not @_;
my $args = {@_};
## set the package to the caller
$PACKAGE = caller();
croak "Must sub-package ".$PACKAGE if not $PACKAGE or $PACKAGE eq __PACKAGE__;
## make sure our sub-packaged module is using the exporter
_export_the_exporter_to( $PACKAGE ) or die "Bad exporting exporter";
## check to make sure ENABLE_CHK exists, and is a hashref ##
if ( not $args->{ENABLE_CHK} or ref $args->{ENABLE_CHK} ne 'HASH' ) {
croak "ENABLE_CHK needs to be set with a hash ref for this module "
."to be used.";
}
lib/Attribute/GlobalEnable.pm view on Meta::CPAN
## checks to see if this debug level is set by a flag being passed in. If
## the flag doesn't exist in our flags hash, then we can assume that
## the flag variable isn't actually a flag, and is probably part of the
## debug arguments... so put it back onto our args list.
my $debug_level = _is_flag_on($attribute, $flag);
if( not defined $debug_level ) {
unshift( @_, $flag ) if not defined $debug_level;
}
my $full_package = (caller(2))[3];
my $caller_sub_name = '';
GET_PROPER_PACKAGE_NAME: {
my @packages = split /::/, $full_package;
pop @packages;
$caller_sub_name = join '::', @packages;
}
$debug_level = _is_attribute_on(
$attribute,
( run in 0.268 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )