http://qs321.pair.com?node_id=836551

halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:

How can I inherit a method, in this example, test():
#!/usr/bin/perl -w use strict; { package One; sub test { my $x = pop; print "$x\n"; } } { package Two; use base "One"; sub new { my $self = {}; bless($self); } sub eg { test(pop); } } my $obj = new Two(); $obj->eg("hello");
I know "One->test()" will work, it just seems strange to me that I could then use $obj->test(), but not test() in Two's definition.