#!/usr/bin/perl use strict; use constant { CLOUD => 9, HELL => 'sytem administration' }; use constant SINS => qw(pride envy gluttony lust anger greed sloth); dump_consts(); sub dump_consts { no strict 'refs'; print "SINS list:\t@{[SINS]}\n\n"; foreach my $const (keys %constant::declared) { printf "%-15s%6s => %s\n", 'eval:', $const, eval $const; printf "%-15s%6s => %s\n", 'symref:', $const, {$const}; printf "%-15s%6s => %s\n", 'symref fqn:', $const, {"constant::$const"}; printf "%-15s%6s => %s\n", 'symref hash:', $const, join(' ', values %{$const}); } } #### SINS list: pride envy gluttony lust anger greed sloth eval: main::CLOUD => 9 symref: main::CLOUD => HASH(0x4002da60) symref fqn: main::CLOUD => HASH(0x4002da60) symref hash: main::CLOUD => eval: main::HELL => sytem administration symref: main::HELL => HASH(0x4005c5f0) symref fqn: main::HELL => HASH(0x4005c5f0) symref hash: main::HELL => eval: main::SINS => pride symref: main::SINS => HASH(0x4005c5fc) symref fqn: main::SINS => HASH(0x4005c5fc) symref hash: main::SINS =>