in reply to Accessing constants via symbol table possible?
use Devel::Symdump; use strict; use warnings; use constant SINS => qw(pride envy gluttony lust anger greed sloth) +; my $dS = Devel::Symdump->new(__PACKAGE__); local $\="\n"; print " here are some constants (prototype '')"; for my $f( $dS->functions ) { my $p = prototype $f; print $f if defined $p and $p eq ''; } __END__ here are some constants (prototype '') main::SINS
|
MJD says you can't just make shit up and expect the computer to know what you mean, retardo! ** The Third rule of perl club is a statement of fact: pod is sexy. |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Accessing constants via symbol table possible?
by ihb (Deacon) on Feb 07, 2003 at 16:46 UTC | |
by PodMaster (Abbot) on Feb 07, 2003 at 17:18 UTC |