On Jun 7, 2012, at 10:19 PM, Brock wrote:

> Finally to your last question, how is this different than just calling the 
> package::sub directly? With a method call the instance variable, in this case 
> $catalog, always gets passed as the first parameter to the method. Usually 
> people name it $self.

        Thanks, Brock.  That is exactly what's happening in this script.  Your 
explanation helped clear things up for me.

> The same thing happens here -- so this is equivalent to:
> 
>  my $item = SurfDB::split_line($catalog, $itemid);


        I'm reading through Intermediate Perl, as pangj suggested, but I have 
one other question.  If the above line is the same as writing:

 my $item = $catalog->SurfDB::split_line($itemid);

as you suggest, why use one over the other?  Is it just a matter of style, or 
is there more to this than meets the eye?

Thanks again,
Marc
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to