Scalar-Constant
view release on metacpan or search on metacpan
lib/Scalar/Constant.pm view on Meta::CPAN
use vars qw( $VERSION );
$VERSION = 0.001_005;
sub import {
my $module = shift;
my %constant = @_
or return;
my $calling_package = (caller)[0];
my @code;
while(my($name, $value) = each %constant) {
if(ref($value)) {
croak 'References are not supported';
}
if(! looks_like_number($value)) {
$value = quote($value);
}
push @code, sprintf('*%s::%s = \ %s;', $calling_package, $name, $value);
}
( run in 0.945 second using v1.01-cache-2.11-cpan-a3c8064c92c )