in reply to getting at the text of an icon

Getting what's in the symbol table for a specific package is pretty easy:
#!/usr/bin/perl package symTest; my $variable_zero = 0; $variable_one = 1; $variable_two = "blue"; $variable_three = 3; for (sort keys %symTest::) { print $_, "\n"; }
However, you'll notice that $variable_zero doesn't show up in the list. That's because 'my'ed variables don't actually appear in the symbol table, so only global (and 'local') variables are listed. My guess is that it would be virtually impossible to get at the 'my' (lexical) variables (but we've got some pretty smart monks here). :-)
Also note that I put the variables in a new package(symTest); the default "main" package has a lot of stuff in it's symbol table that you probably don't want to wade through.

Impossible Robot

Replies are listed 'Best First'.
Getting at lexicals
by robin (Chaplain) on Dec 13, 2001 at 20:55 UTC
    Check out my PadWalker module for a way to get at lexical variables. Of course, that's an even worse idea unless you're doing some very deep magic. Or just for fun :-)