> G'day... > > I've noticed a lot of modules can be initialised in the form: > > my $instance = Module->new( option => "value1", option2 => "value2" ) > > How is this implemented? Is the above simply passing a hash reference? > > Is it something like: > [snippage snipped] > > TIA! > > > Regards, >
Not a hash reference, a hash ... sub method { my ($class, %opt) = @_ ; . . . } -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>