in reply to Re: Reading the script code from itself
in thread Reading the script code from itself

Your use case is weird, instead of using constants I would choose hash (or array) elements right away from the beginning!

Anyway your constants live in the STASH of your package and you seem to have a clear naming convention...

....so just grep {/^MM/} keys %YourPkg:: to find those symbols.

Introspection is always better than parsing code!

HTH! :)

Cheers Rolf

( addicted to the Perl Programming Language)

update

example:

DB<110> $a=3 => 3 DB<111> grep /^a/,keys %main:: => ("a", "attributes::")