noobee has asked for the wisdom of the Perl Monks concerning the following question:
where Data::Container is another package as below:package Library; sub new { my ($class, $fname) = @_; my $self = { library => undef }; bless $self, $class; my $lib = Data::Container->new(); my $libfile = Data::File->new($fname); $lib->read($libfile); ($self->{library}) = ($lib->get_list("library")); return $self; } sub get_list { my ($self, @keywords) = @_; return $self->{lib}->get_list(@keywords); }
package Data::Container; sub new { my $class = shift; my $self = { line => shift, items => undef, close => undef, }; $self->{line} = "" unless $self->{line}; bless $self, $class; }
package Data::File; sub new { my $class = shift; my $self = { file => iFile->new(shift) }; bless $self, $class; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A new user question on OO Perl
by chromatic (Archbishop) on Dec 19, 2007 at 05:11 UTC | |
by Anonymous Monk on Dec 19, 2007 at 05:57 UTC | |
by chromatic (Archbishop) on Dec 19, 2007 at 08:42 UTC | |
|
Re: A new user question on OO Perl
by kyle (Abbot) on Dec 19, 2007 at 05:11 UTC | |
by Anonymous Monk on Dec 19, 2007 at 05:27 UTC | |
by BrowserUk (Patriarch) on Dec 19, 2007 at 06:00 UTC |