isync has asked for the wisdom of the Perl Monks concerning the following question:
package App; sub new { my ($class, %args) = @_; my $self = bless { %args }, $class; $self->{widget} = App::Widget->new( $self ); return $self; } package App::Widget; my( $class, $self ) = @_; my $widget = bless { }, $class; $self->{menu} = App::Widget::Menu->new( $self, $widget ); return $self; } package App::Widget::Menu; sub new { my( $class, $self, $widget ) = @_; my $menu = bless { }, $class; # let's do something with %{ $self } here; $self->{some_arg} = 1; $self->{menu}->BackgroundColor(222,222,222); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Advice please on variable naming style in modules (role > pos)
by tye (Sage) on Aug 21, 2012 at 18:21 UTC | |
by isync (Hermit) on Aug 22, 2012 at 14:35 UTC | |
Re: Advice please on variable naming style in modules
by Jenda (Abbot) on Aug 21, 2012 at 21:41 UTC | |
by isync (Hermit) on Aug 22, 2012 at 14:42 UTC | |
by Jenda (Abbot) on Aug 22, 2012 at 14:51 UTC | |
by isync (Hermit) on Aug 22, 2012 at 21:08 UTC | |
Re: Advice please on variable naming style in modules
by Anonymous Monk on Aug 21, 2012 at 19:04 UTC | |
by isync (Hermit) on Aug 22, 2012 at 14:37 UTC |