On 4/16/09 Thu  Apr 16, 2009  2:25 PM, "Chas. Owens" <chas.ow...@gmail.com>
scribbled:

> 2009/4/16 Jim Gibson <jimsgib...@gmail.com>:
> snip
>> This calls the new method in package vpu and assigns the return value, which
>> should be a blessed scalar of some type, usually a reference to a hash, but
>> it could be any scalar.
> snip
>> $vpu must be a blessed scalar in order to call methods on it. Packages
>> netElement::vpu and vpu are not the same.
>> 
>> It is also possible that the new() method has not returned a valid object
>> (blessed scalar) for some reason. You should look at the source code for the
>> new() method and see why that might be.
> snip
> 
> Nit picking: you can only bless references, not all scalars.

Thanks for the clarification. I believe you can bless any scalar, but the
result, the return value from the bless function, is a reference to that
scalar. I always use hash references for object instances, but there are
some conditions under which using a string or an integer might be
advantageous.



-- 
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