...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 ?
In reply to Re^2: displaying package variable from inherited method.
by wazoox
in thread displaying package variable from inherited method.
by wazoox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |