I am running up against a culture clash between a VB programmer who wrote some OLE accessible code and my understanding of Perl usage. I've gotten a lot of complex stuff to work, but hit a brick wall on this one. I hope someone here can educate me. This is using Win32::OLE
VB usage:
$OLE1.Net.PasswordTimeout = 45
This works in VB.

my Perl translation:
$OLE->Net->PasswordTimeout = 45;
returns "can't modify non-lvalue ..." as I expected.

I thought it should be:
$OLE1->Net->PasswordTimeout(45);
This returns a "does not support a collection" error.

I think the VB programmer has done something very wrong, and the second perl syntax is correct. He is trying to use the same syntax to both get and set the value.
i.e. $h = $OLE->Net->PasswordTimeout;
works correctly and returns the proper value. But I do not understand how he would be setting the value using the equate the same way. Yet the VB code works fine, while the perl gives errors. I think he should use a new method SetPasswordTimeout to set it. Most other objects have distinct read and write methods, but not this one. Of course, since his VB code works to access the function, he thinks perl is at fault. I'm thinking perl is catching an error that VB is permitting. Just because VB allows it does not mean it is correct, right? Or is there a different perl syntax for this sort of thing that I am ignorant of? I've spent a lot of time reading about objects in perl, but I remain ignorant.

Clearly I am beyond my experience. Can someone explain to me where I am failing?
Thanks,
Nat

In reply to Perl and OLE Help needed by wa4otj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.