All,
I have been stumped by this one for a while, and was hoping you all could help. I have a pair of classes, the second inherits from the first -- like this:
package Foo::Bar;
use strict;
use Exporter;
use vars qw( @ISA @EXPORT_OK );
@ISA = qw(Exporter);
@EXPORT_OK = qw(&doSomething);
sub new {
blah blah blah...
}
sub dosomething {
blah blah blah
}
package Foo::Bar::Blah;
use strict;
use Foo::Bar qw(doSomething);
use vars qw( @ISA );
@ISA = qw(Foo::Bar);
Now in (sample) code I have the following:
use strict;
use Foo::Bar::Blah;
Foo::Bar::Blah::doSomething('xyz');
I get the following error:
Use of inherited AUTOLOAD for non-method Foo::Bar::Blah::doSomething()
+ is deprecated at ./tests/testFooBarBlah.pl ...
Can't locate auto/Foo/Bar/Blah/doSomething.al in @INC ...
This doSomething() function is intended to be able to be called as either a method of an instance or a straight function call.
If I call it like:
Foo::Bar::doSomething('xyz');
There is no issue reported, and it appears to function properly.
Can anybody shed some light on this?
Note: this is using perl 5.8.2
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.