Dear esteemed PerlMonks I am trying to run an example from perlobj (it's titled: "How SUPER is Resolved", about a third into the page here: http://perldoc.perl.org/perlobj.html). Here is the script: # taken from: http://perldoc.perl.org/perlobj.html
use strict;
use warnings;
use 5.014;
package A;
sub new {
return bless {}, shift;
}
sub speak {
my $self = shift;
$self->SUPER::speak();
say 'A';
}
package B;
use parent 'A';
sub speak {
my $self = shift;
$self->SUPER::speak();
say 'B';
}
package C;
use parent 'B';
sub speak {
my $self = shift;
$self->SUPER::speak();
say 'C';
}
my $c = C->new();
$c->speak();
then compilation fails with: Can't locate A.pm in @INC (@INC contains:
E:\My Documents\Technical\Perl\Eclipse workspace\C files
E:\My Documents\Technical\Perl\Eclipse workspace\OCR
F:/Win7programs/Dwimperl/perl/site/lib
F:/Win7programs/Dwimperl/perl/vendor/lib
F:/Win7programs/Dwimperl/perl/lib
.)
at F:/Win7programs/Dwimperl/perl/lib/parent.pm line 20.
BEGIN failed--compilation aborted at obj test.pl line 16.
My system: DWIM Perl 5.14.2 on Windows 7. Your help will be appreciated Many TIA - Helen
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|