develooper Front page | perl.beginners.cgi | Postings from October 2014

cgi and inheritance

Thread Next
From:
Patton, Billy
Date:
October 6, 2014 13:33
Subject:
cgi and inheritance
Message ID:
7781CFE0-B5A0-40D0-A9BA-103ADEFEA607@hypercube-llc.com
I’ve recently inherited some code that hasn’t been touched in over 5 years. It’s all cgi and OOPerl.
I’ve ran across this one statement that I don’t understand.

$self->log->error(*)

I know the self
and I’ve traced the error to CGI::Application through inheritance.
But it’s the ->log-> that has me confused.
I have no class named log
I find no place that is does a new on log anywhere in the family tree.
I cannot find any log class anywhere in the family tree of inheritance.

Is this just a method of using a perl hash that I’m not familiar with?
Could it be rewritten as 
$self->{‘log’}->error(*);

Using perl 5.16.2
on MAC 10.9.5
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About