using underscore in package

Discussion in 'Perl Misc' started by soup_or_power@yahoo.com, Oct 18, 2005.

  1. Guest

    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
     
    , Oct 18, 2005
    #1
    1. Advertising

  2. Matt Garrish Guest

    <> wrote in message
    news:...
    > 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
     
    Matt Garrish, Oct 19, 2005
    #2
    1. Advertising

  3. Anno Siegel Guest

    Matt Garrish <> wrote in comp.lang.perl.misc:
    >
    > <> wrote in message
    > news:...
    > > 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).


    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
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
     
    Anno Siegel, Oct 19, 2005
    #3
  4. Matt Garrish Guest

    "Anno Siegel" <-berlin.de> wrote in message
    news:dj60cc$9sd$-Berlin.DE...
    > Matt Garrish <> wrote in comp.lang.perl.misc:
    >>
    >> <> wrote in message
    >> news:...
    >> > 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).

    >
    > 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
     
    Matt Garrish, Oct 19, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Antonio
    Replies:
    2
    Views:
    430
    tdavisjr
    Nov 4, 2005
  2. Kerry Kimbrough
    Replies:
    6
    Views:
    14,955
    Chris Smith
    Feb 27, 2004
  3. ABC
    Replies:
    1
    Views:
    2,021
    Kevin Spencer
    Apr 22, 2006
  4. Mikael Petterson

    Problem to remove underscore in template

    Mikael Petterson, Sep 20, 2003, in forum: XML
    Replies:
    4
    Views:
    586
    Mikael Petterson
    Sep 20, 2003
  5. Kanon
    Replies:
    1
    Views:
    455
    Florent Georges
    Dec 26, 2005
Loading...

Share This Page