in reply to package symbol table syntax?

I don't get the results that you are getting, so I suspect that there is some code missing here. However, I can make an educated guess as to what might be related to this problem. Here's some sample code.

#!/usr/local/bin/perl -w use strict; package Foo; $Foo::VERSION = '.01'; package main; $|++; print Foo->VERSION,$/; $main::VERSION = '.02'; print main->VERSION, $/; print $main::{'VERSION'},$/; print Foo->asdf;

And here's the output:

.01 .02 *main::VERSION Can't locate object method "asdf" via package "Foo" at ./test.pl line +12.

You'll notice that we had no problem calling a VERSION() method in the %Foo:: namespace (and the %main:: namespace), but we couldn't call Foo->asdf(). VERSION() is a special method in the %UNIVERSAL:: namespace which all classes inherit. By calling this as a class method on the %main:: namespace, we treat %main:: as a class, thus inheriting VERSION(). I suspect that if we see the rest of your code which exhibits this strange behavior, it will somehow be related to this issue.

See perldoc UNIVERSAL for more details.

Cheers,
Ovid

Join the Perlmonks Setiathome Group.

New address of my CGI Course.