Phoenix.pm: Symbol Tables

EdelSys Consulting edelsys at edelsys.com
Sun Oct 3 21:01:14 CDT 1999


At 09:38 PM 10/03/1999 EDT, you wrote:

You piqued my curiosity on this one.  So, I wrote a little symbol table
dumper:

---

package blah;

my $a = 'a';
my $b = 'b';
local $d = '';

sub c

{ my($c,$d)=@_;
  return($c+$d); }

my $name = '';

foreach $name ( keys(%blah::) )

{ print("$name\n"); }

exit(0);

---

For package main (default package), use %main::

Advanced Perl Programming book has a more involved dumper.

Tony

>I have a situation where I would like to know if a certain subroutine name 
>has already been defined.  Do any of you guys know how to check the symbol 
>tables for that?  I have tried a few typeglob solutions but none seem to 
>work.  I know that I can eval the code and then check the existence of error 
>messages ($@), but I'd rather not.
>
>I thought I found the answer on page 282 of the "Camel Book". But checking 
>the definedness of:
>    *main::load_email{CODE}
>did not test as I'd expect.
>
>Any solutions?
>
>Also, I'm beta testing my Internet Contact Manager.  If you're curious and 
>would like to try to spoof the script (hopefully unsucessfully), you can add 
>yourself to the database and test it out.  The email address will have to be 
>legit to get a password, but all the other stuff can be as phony as you'd 
>like.
>
>The script sort of showcases all the packages that I have been working on
for 
>the past 6 months or so, since I started on my OOP kick.  All the HTML is 
>generated with Tag.pm and all of the form variable processing is done with 
>FormVar.pm
>
>Tell me what you think.
>
>http://www.azwebs.com/cgi-local/ICM/amd/amd.cgi
>
>The user side (database searching and mass emailing) is my next step to 
>completing the project.  This also could be modified to serve as the Phoenix 
>PM email contact and member list in the future...
>
>Hopefully I'll be able to see some of y'all on the meeting on the 5th.
>
>Tim
>



More information about the Phoenix-pm mailing list