in reply to Re^3: Abstract Factory
in thread Abstract Factory
doesn't understand the role of shift and bless, completely; where we have greeting and repeat are being shift.package Greet::Repeat; sub new { my $class = shift; my $self = { greeting => shift, repeat => shift, }; return bless $self, $class; } sub greet { my $self = shift; print ($self->{greeting} x $self->{repeat}); } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Abstract Factory
by Anonymous Monk on Oct 06, 2005 at 06:05 UTC |