[EMAIL PROTECTED] (Joe Schaefer) wrote:
>
>"Christopher L. Everett" <[EMAIL PROTECTED]> writes:
>
>> sub handler ($$) {
>> my ($self, $q);
>>
>> my $r = Apache::Request->new($q);
>>
>> # send headers here
>>
>> print $self->name;
> ^^^^^^^^^^^^
>$self is a string ("simian"), not an object ref; for this
>line to work, you need to make one by calling "new" somewhere,
>or guard against misuse via:
>
> print $self->name if ref $self;
Technically there's nothing wrong with that, it'll call the name()
method of the "simian" class. It may not be what you want to do, but
it's legal.
The error is that the name() method doesn't expect to be called as a
class method, it's an object method. So as Joe points out, you could
add the following line:
sub handler ($$) {
my ($self, $q);
-> $self = $self->new();
my $r = Apache::Request->new($q);
# send headers here
print $self->name;
return OK;
}
------------------- -------------------
Ken Williams Last Bastion of Euclidity
[EMAIL PROTECTED] The Math Forum