in reply to Re: displaying package variable from inherited method.
in thread displaying package variable from inherited method.
...Prints the variable $data in package "proto".
Bummer... Of course ! shame on me... So there isn't any way around ? What do you think of this :
Child.pm :Then Parent.pm:use strict; use warnings; package Child; use Data::Dumper ; use base 'Parent' ; sub data { return { one => 1, two => 2 } }; 1;
use strict; use warnings; package Parent; use Data::Dumper ; sub new { my $proto = shift ; return bless {}, $proto } sub show { my $self = shift ; my $proto = ref $self ; print $proto->data(); print Dumper $proto->data() } 1;
The script code remains of course unchanged. Unless I... May it be possible to get it working the way I meant by using tie ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: displaying package variable from inherited method.
by Joost (Canon) on Jun 10, 2006 at 15:10 UTC | |
by wazoox (Prior) on Jun 10, 2006 at 15:21 UTC |