Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Simple inheritance question

by halfcountplus (Hermit)
on Apr 23, 2010 at 16:59 UTC ( #836567=note: print w/replies, xml ) Need Help??


in reply to Re: Simple inheritance question
in thread Simple inheritance question

Yeah, that does it:
#!/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");
Thanks all!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://836567]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-08-13 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (75 votes). Check out past polls.

    Notices?