jason_s has asked for the wisdom of the Perl Monks concerning the following question:
When I run this, I get:#!/usr/bin/perl use strict; use warnings; my $obj=TestSubClass->new; { package TestClass; sub new { my $class = shift; my $self = {}; print "I'm brand new!\n"; bless $self, $class; } } { package TestSubClass; our @ISA=("TestClass"); }
What am I doing wrong? Why isn't "new" getting found?> ./oo_test Can't locate object method "new" via package "TestSubClass" at ./oo_te +st line 5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: basic inheritance question
by NetWallah (Canon) on Jun 05, 2009 at 00:29 UTC | |
by ikegami (Patriarch) on Jun 05, 2009 at 02:53 UTC | |
by JavaFan (Canon) on Jun 05, 2009 at 08:12 UTC | |
by NetWallah (Canon) on Jun 05, 2009 at 20:31 UTC | |
by shmem (Chancellor) on Jun 05, 2009 at 21:25 UTC | |
by trwww (Priest) on Jun 05, 2009 at 01:56 UTC | |
by jason_s (Acolyte) on Jun 05, 2009 at 00:40 UTC | |
by ikegami (Patriarch) on Jun 05, 2009 at 02:56 UTC |