Re: referencing a param and $self in an OO subroutine
- From: "Mumia W." <paduille.4060.mumia.w+nospam@xxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 23:38:12 GMT
On 03/20/2007 11:18 AM, Marc wrote:
I've made some progress based on your feedback. When I tried:
my ($self, $sheetname) = @_;
it thought $self was the value of what the $sheetname was supposed to
be, throwing the following error:
Use of uninitialized value in concatenation (.) or string at line 161.
Can't locate object method "workbook" via package
"[sheetnameVariable]" (perhaps you forgot to load
"[sheetnameVariable]"?) at line 162.
the print sheetname statement had output:
"sheetname = "
So I flipped them and the print sheetname statement had output:
"sheetname = [sheetnameVariable]"
but I got this error at the same line (161):
"Can't call method "workbook" on an undefined value"
so apparently it still doesn't know what $self is. This method is
being called from another method in the module with like this:
my $Work*** = CreateWork***($title);
That's not how you call methods. Try this:
my $Work*** = $self->CreateWork***($title);
Read "perldoc perlboot" again.
sub CreateWork***
{
my ($sheetname, $self) = @_;
If this is a method, $self will go first.
[...].
- References:
- referencing a param and $self in an OO subroutine
- From: Marc
- Re: referencing a param and $self in an OO subroutine
- From: Mumia W.
- Re: referencing a param and $self in an OO subroutine
- From: Marc
- referencing a param and $self in an OO subroutine
- Prev by Date: Re: referencing a param and $self in an OO subroutine
- Next by Date: Problem installing XML::Checker
- Previous by thread: Re: referencing a param and $self in an OO subroutine
- Next by thread: Re: referencing a param and $self in an OO subroutine
- Index(es):