Lakka,

Why are you passing the scalar object reference by reference to your
function? Just pass it as per normal and it will save you dereferencing
it with $$. Also, why do you have a '\' char before $_[0]? You're
creating another reference there. And are you actually blessing
$dxfInstance into a package anywhere in your code?

The code you've included below seems a little unorthodox. I recommend
investing in Damian Conway's excellent book 'Object Oriented Perl' if
you haven't got it already.

Lakka Sami wrote:

> Hi,
>
> I'm having problems with OOP and Perl. I have an class
> named DXFobject and an other class that puts these objects
> in an array ( like push @AoO, [dxfInstance] ).
> Now I want to access a objects method thru reference (before
> I put them into an array ) :
>
> func(\$dxfInstance);
>
> sub func
> {
>   $ref_to_obj = \$_[0];
>
>   @array = $$ref_to_obj->get_data();
> }
>
> but Perl says that it can't call method get_data() on an
> unblessed reference. What should I do?
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

--
Mark Maunder
Senior Architect
SwiftCamel Software
http://www.swiftcamel.com
mailto:[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to