in reply to Class Inheritance Abuse. Best way to fix it?
For example, drop BLL::OtherPackage from your use base list, but use it instead like this:
Then change BLL::OtherPackage so it exports:package My::App; use strict; use warnings; use base qw(CGI::Application); use BLL::OtherPackage qw( sub_in_other_file );
In closing, I urge you not to guilty when you use Perl features to get your job done.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;
Phil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Class Inheritance Abuse. Best way to fix it?
by girarde (Hermit) on Jun 05, 2006 at 21:21 UTC | |
by diotalevi (Canon) on Jun 05, 2006 at 21:45 UTC |