in reply to Reading arrays

I'm trying to read a list of elements through a windows com+ application, the application is returning a list of words with 3 chars each in a csv format, i would expect someting like "abc','def',ghi" and so on. Code: ------
#! /usr/bin/perl -w use Data::Dumper; use Win32::OLE; my $fso = Win32::OLE->new("HHCOM.GeoSearch.CircleRangeSearch"); @geo = $fso->FindLocationsInCircleRange("CGN",70) ; print Dumper(@geo); foreach my $records (@geo){ print "$records\n"; }
------ the output of $result doesnt show me the elements where i'm lookking for. Dumper(@geo) returns: gives me:
$VAR1 = [ 'BNJ', 'CGN', 'DUS', 'ESS', 'MGL', 'SGE' ];
How can i read them?

Replies are listed 'Best First'.
Re^2: Reading arrays
by GrandFather (Saint) on Feb 26, 2011 at 21:56 UTC

    Most likely FindLocationsInCircleRange returns an array reference so you need:

    #! /usr/bin/perl use strict; use warnings; use Data::Dumper; use Win32::OLE; my $fso = Win32::OLE->new ("HHCOM.GeoSearch.CircleRangeSearch"); my $geo = $fso->FindLocationsInCircleRange ("CGN", 70); print Dumper ($geo); for my $records (@$geo) { print "$records\n"; }
    True laziness is hard work