I may be totally off-base here, but this part of your code looked strange, and struck me as possibly being related to your problem -- it just doesn't seem right, in any case:
package test; use gadget; use vars qw($VERSION $CLASS); $CLASS = __PACKAGE__; $VERSION = "0.01"; BEGIN { @test::ISA = qw(gadget); @test::ISA = qw(Exporter); @test::EXPORT = qw(parse_tag); }
First off, why put a BEGIN block inside a package? If you're going to load this as a module via "use test;", then the script that invokes this "use" statement is already handling the package within its own BEGIN block. If you're loading it with "require test;" then I think it's already too late for your package's BEGIN block to be heeded as such.

Second, I would have thought that the assignment to @ISA should go like this:

@ISA = qw/gadget Exporter/;
You're already in "package test" at this point, so having "@test::ISA" seems redundant. But the main point is that in the code you posted, the assignment of "Exporter" to @ISA would appear to replace (obliterate) the preceding assignment of "gadget" to that array.

I actually haven't had much practice with OO inheritance, but just in terms of basic Perl syntax, you may want to take a closer look at these things (and let me know if I'm wrong). Good luck.


In reply to Re: reference to a subroutine inside a package by graff
in thread reference to a subroutine inside a package by imcsk8

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.