It might not make you feel better, but you could mixin, by having the other module explicitly export methods you need. This avoids some of the problems of multiple inheritence (it lets you pick and choose which methods you want and can make things more explicit, saving time with collisions happen).

For example, drop BLL::OtherPackage from your use base list, but use it instead like this:

package My::App; use strict; use warnings; use base qw(CGI::Application); use BLL::OtherPackage qw( sub_in_other_file );
Then change BLL::OtherPackage so it exports:
package BLL::OtherPackage; use strict; use warnings; use base 'Exporter'; our @EXPORT_OK = qw( sub_in_other_file ); sub sub_in_other_file { my $self = shift; # $self would be what I expected if I didn't put this in # the 'use base' or @ISA for that matter. What an abuse. } 1;
In closing, I urge you not to guilty when you use Perl features to get your job done.

Phil


In reply to Re: Class Inheritance Abuse. Best way to fix it? by philcrow
in thread Class Inheritance Abuse. Best way to fix it? by BMaximus

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.