On Nov 6, 9:36 am, [EMAIL PROTECTED] (Lawrence Statton) wrote:
> > I have a function in a lib that we use that has two referenced
> > hashes.
>
> No, you have a method in a class that has two referenced hashes.
> Computers are frustratingly pedantic, and mastering the art requires
> the same level of attention do detail at the human leve.

Classes *are* libraries.  Methods *are* functions.

A class is simply a module that contains one or more subroutines which
function as methods.
A method is simply a function that expects either a class name or
blessed reference as its first argument.

What he said was correct.  What you said was simply more specific.

> > my $zone   = $self->{'zone'};
> > my $params = $self->{'report-params'};
> > my %zone_list = ();
>
> > $count = $zone->generate_zone_list(\%zone_list,\%params);
>
> You should have gotten a warning here remarkably similar to:
>  Global symbol "%params" requires explicit package name at /tmp/test.pl line 
> 9.  

1) that's a compilation error, not a warning.  What was it you said
about a pedantic level of detail?
2) That error will only be displayed if the OP is using strictures.
Nothing in his post indicates that he is.

> One can glean since $params->scheduleId() provides the response that
> you want, that $params is an object, and you don't need to pass it by
> reference.

This is nonsensical.  ALL subroutines in perl are passed by
reference.  I think you meant "You do not need to pass a reference to
it", which is remarkably different.  There's that less than pedantic
attention to detail again...

Paul Lalli


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to