sierrathedog04 has asked for the wisdom of the Perl Monks concerning the following question:
$group = new Apache::Htgroup ($path_to_groupfile)
The constructor code is as follows:
package Apache::Htgroup; use strict; use vars qw($VERSION); $VERSION = '0.9'; sub new { my ($class, $groupFile) = @_; my ($self) = {}; bless ($self, $class); $self->{'groupfile'} = $groupFile; return $self; } # End sub new
One calls new with a single parameter $path_to_group_file
Yet the code reads the values of two variables, $class and $groupFile from @_
What is going on? Where does the extra value for $class come from? Any help would be greatly appreciated, as the Llama and Camel books do not contain a clue as to this riddle.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Curious Constructor Syntax
by dws (Chancellor) on Feb 16, 2001 at 06:44 UTC | |
|
Re: Curious Constructor Syntax
by MeowChow (Vicar) on Feb 16, 2001 at 06:55 UTC |