in reply to parsing Win32::OLE::Variant

To find out how to get at the data in $bbData, you need to read the documentation supplied by your vendor, that is, Bloomberg. Most likely $bbData will contain a Collection and hence the Win32::OLE::in function will work for you:

for my $item (in $bbData) { ... };

Also, you should get into the habit of use strict; because if you fix that error, you'll be using a variable @bbData a few lines below that. The variable @bbData does not exist and Perl will stop you from using it if you allow it to by use strict;.

Replies are listed 'Best First'.
Re^2: parsing Win32::OLE::Variant
by kevind0718 (Scribe) on Sep 26, 2008 at 16:49 UTC
    Try the following:
    for my $item ( in $bbData) { print 'Dumper $item: ', Dumper $item . "\n"; # }
    and got
    -1 subMode: 1 Error: 0 Dumper $bbData: $VAR1 = bless( do{\(my $o = 27085052)}, 'Win32::OLE::V +ariant' ); Can't locate object method "in" via package "Win32::OLE::Variant" at t +stblpSubscribe.pl line 43.
    In VBA a two dimension arry is returned
    any suggestions

    kd

      You need to import the in function from Win32::OLE. Read the documentation on how to import and use in. Alternatively, you likely can call the ->Item method on your object, because most collections use that name to access their entries. Again, I can also only refer you to the documentation that the vendor provides.

        Hello: Many thanks for your quick reply. The documentation is lacking, it is written for VB/VBA and it just sort-a-kinda works.

        In VB the return is Variant/Variant(0 to 0, 0 to 2). And it behaves like a two dimension array.

        . I will import the IN function as you suggested.

        thanks for your assistance.

        KD
        I gave the documentation a good read through and do not have clue how to import the IN function. I am certain that the data is in $bbData but I clueless as how to get at it.

        how do you know that $bbData is a collection?

        KD