This got buried so I'm putting it up again at the top level.

I have a problem with a naming structure inherited from the guy who wrote a package that I'm working to supersede. Say the module/package is named XYZ::ABC. Using this package, people want to tie to names like XYZ::ABC::Scalar. The way he did this was to write out the names of the tie routines in full in ABC.pm, like this:
# Preloaded methods go here. sub XYZ::ABC::Scalar::TIESCALAR { my $class = shift; my ($val) = @_; return bless \$val, $class; }
This works in preloaded form, but it seems it can't be autoloaded.

What do can I do to keep the inherited naming structure and autoload the tie routines? Can I put multiple package statements/sections in my one ABC.pm file?

If each package needs a separate .pm file, the changes to my Makefile.PM will be extensive. Do I recall a bit in the ExtUtils::MakeMaker docs about handling multiple things in one Makefile.PM?

In all there are 6 "tie-to" names and 52 "tie interface" routines. Even though each one has a pretty simple structure like:
sub XYZ::ABC::Array::STORE { my $self = shift; abc_array_store ($self->{ARRAY}, @_); }
52 of them make autoloading seem worthwhile. Although if they are in separate packages, each one containing only the tie routines for one "tie-to" name, maybe autoloading isn't worthwhile?

Thanks to any monk who can help,
cmac
www.animalhead.com

In reply to Autoloading tie routines by cmac

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.