SPUG: Long module names and perl "classes"?

Joe Slagel slagel at geospiza.com
Fri Sep 3 15:23:34 CDT 1999


"Abarbanel, Robert" wrote:

> You know those class-name-strings are just that, strings.
> You can say $s = "MyTopDir::MySubDir::MySubSubDir::MyObject"
> and then
> $newobj = $s->new()

I guess a large resounding "DUH" is approriate right now.  Didn't see the
forest because of the trees.  Thanks.

BTW, I like the idea of doing it like:

use constant MyObject => "MyTopDir::MySubDir::MySubSubDir::MyObject;
my $newObj = MyObject->new();

- Joe


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list