use constant { MY_CONSTANT1 => 1, MY_CONSTANT2 => 2, MY_CONSTANT3 => 3, MY_CONSTANT4 => 4 }; sub useConstants { #able to use constants fine in here... my $var = MY_CONSTANT4; print "$var\n"; #outputs '4' } 1;