in reply to Something I'd really like to know about OOP Perl.
Looking at your code, I think one thing that you're missing is that the $self you create in new is also available in display. You could do this:
sub display { my $self = shift; my $link_file = $self->{link_file}; my $adate = $self->{adate}; # etc. }
That's true as long as display is called as an instance method (i.e., as you say, $whatever->display()). Called as a class method (Records_tagged->display()), all it gets for $self is the string, 'Records_tagged'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Something I'd really like to know about OOP Perl.
by Sagacity (Monk) on Jan 10, 2007 at 23:39 UTC |