in reply to Re^4: Win32::OLE::Variant Array
in thread Win32::OLE::Variant Array

We may actually be closer then I thought.
I reran the VB code and got a result similar to what PERL returned. This is good.
What I need to understand now, is what is dump saying.
Would would you be kind enough to give me some clue what is going on below.
many thanks
kd
$VAR1 = [
[
bless( do{\(my $o = 27163868)}, 'Win32::OLE::Variant' ), '#N/A Mth Lmt'
]
];

Replies are listed 'Best First'.
Re^6: Win32::OLE::Variant Array
by almut (Canon) on Aug 21, 2007 at 19:25 UTC

    It looks like you are getting a 3-dimensional array, with the top level array being an arrayref (in Perl, all nested arrays must be arrayrefs anyway). Data::Dumper essentially prints out the data structure as Perl code which, when executed, would (re-)create the data structure being dumped (ok, manual object instantiation would typically be done in a more readable fashion, but you get the idea...).

    (BTW, the representation of the squared brackets of the innermost array has automagically been turned into a fake link, because you weren't using <code> tags... but anyway :)

    The two values of the innermost array are a Win32::OLE::Variant object, and a regular string. This means you can access/print the given data structure like this:

    # get the type of the variant, as a number/ID # (see the docs or Variant.pm for what they represent) print $v->[0][0][0]->Type(), "\n"; # the stringified value of the object, if scalar # (for lists, use ->Dim() and ->Get() ...) print $v->[0][0][0], "\n"; # the string '#N/A Mth Lmt' - nothing special here print $v->[0][0][1], "\n";

    In case you should ever be getting more than one pair of values, you'll of course want to use loops...  Good luck!