in reply to Re: Simple inheritance question
in thread Simple inheritance question
Yeah, that does it:
Thanks all!#!/usr/bin/perl -w use strict; { package One; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(test); sub test { my $x = pop; print "$x\n"; } } { package Two; use base "One"; sub new { One->import; my $self = {}; bless($self); } sub eg { test(pop); } } my $obj = new Two(); $obj->eg("hello");
In Section
Seekers of Perl Wisdom