Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Working with COM objects

by MadraghRua (Vicar)
on May 22, 2009 at 19:07 UTC ( #765728=note: print w/replies, xml ) Need Help??

in reply to Working with COM objects

Alright, I had a deeper look into Win32::OLE and came across the following

$tool->LetProperty('Molecule',$data); $tool->setProperty('Molecule, $data);
So it turns out that the LetProperty method loads the $data instance into the Molecule attribute of the $tool instance. I'll be looking more closely at this to understand why this worked over the previous syntactic sugars that i was using.

I hope this node helps someone else in the future

yet another biologist hacking perl....

Replies are listed 'Best First'.
Re^2: Working with COM objects
by Anonymous Monk on May 23, 2009 at 07:21 UTC

    In Win32::OLE property assignment using the hash syntax is equivalent to the Visual Basic Set syntax (by reference assignment):

            $Object->{Property} = $OtherObject;

    corresponds to this Visual Basic statement:

            Set Object.Property = OtherObject

    To get the by value treatment of the Visual Basic Let statement

            Object.Property = OtherObject

    you have to use the LetProperty() object method in Perl:

            $Object->LetProperty($Property, $OtherObject);

    LetProperty() also supports optional arguments for the property assignment. See OBJECT->SetProperty(NAME,ARGS,VALUE) for details.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://765728]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2018-06-23 13:04 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.