I am writing an extension to (or subclassing, or whatever) MathML::Entities - MathML::Entities::Approximate. I would like my package four things:

  1. Perform a lookup on a data hash defined within itself
  2. Pass on any function/method calls not defined in MathML::Entities::Approximate up to MathML::Entities (preferably without having to do:
    sub name2numbered {return MathML::Entities::name2numbered(@_)}
  3. Load MathML::Entities for the user, even though they only ask for MathML::Entities::Approximate
  4. Extend the %ENTITIES hash in MathML::Entities [defined with my %ENTITIES = (.....) ]

MathML::Entities exports two funtions automatically, and I want to be available even though only use MathML::Entities::Approximate; has been called.

  1. This is easy - done that.
  2. I read that this should just be a case of a use base MathML::Entities... but it's not happening. I've also tried use MathML::Entities; our @ISA = qw(Exporter MathML::Entities); - to no avail: the exported function from MathML::Entities is not available
  3. This is causing me problems. %ENTITIES is defined as a my variable in MathML::Entities - so how to I access it and add to it such that MathML::Entities functions can access the new data.

Any pointers/tips/advice/hand-holding/etc...?



-- Ian Stuart
A man depriving some poor village, somewhere, of a first-class idiot.

In reply to Modifying/extending a superclass' data by kiz

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.