HelenCr has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Example from perlobj failing?
by chromatic (Archbishop) on Mar 15, 2013 at 05:35 UTC | |
|
Re: Example from perlobj failing?
by NetWallah (Canon) on Mar 15, 2013 at 05:43 UTC | |
by tobyink (Canon) on Mar 15, 2013 at 06:39 UTC | |
by HelenCr (Monk) on Mar 15, 2013 at 07:49 UTC |