using underscore in package

S

soup_or_power

Hi
I am trying to understand in some code I am required to maintain
the following declaration:

use base qw(BOB::_::Entity);

Can someone please explain what the underscore means?

Thanks in advance
 
M

Matt Garrish

Hi
I am trying to understand in some code I am required to maintain
the following declaration:

use base qw(BOB::_::Entity);

Can someone please explain what the underscore means?

It doesn't mean anything more than you're inheriting from the module
Entity.pm which is in a directory called \BOB\_\ (which is a little bizarre,
but whatever turns you on).

Matt
 
A

Anno Siegel

Matt Garrish said:
It doesn't mean anything more than you're inheriting from the module
Entity.pm which is in a directory called \BOB\_\ (which is a little bizarre,
but whatever turns you on).

Not necessarily. The base pragma doesn't require its base classes to be
loaded from a file, it is happy if they aren't empty (if anything at
all is defined in the package). The mystery class BOB::_::Entity could
be defined in the same file before "use base ...". The name is, of course,
unusual, but valid and not special at all.

Anno
 
M

Matt Garrish

Anno Siegel said:
Not necessarily. The base pragma doesn't require its base classes to be
loaded from a file, it is happy if they aren't empty (if anything at
all is defined in the package). The mystery class BOB::_::Entity could
be defined in the same file before "use base ...". The name is, of
course,
unusual, but valid and not special at all.

Very true.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top