I don't know about Win32::OLE, but you could use Data::Dumper to print
$everything to STDERR and see how it looks inside.
print STDERR Dumper $everything;
On Mon, 28 Aug 2006 18:43:35 -0400
[EMAIL PROTECTED] ("Stephan Gross") wrote:
> I'm reading in an Excel spreadsheet using Win32::OLE. I want to read
> in the entire spreadsheet. I found a piece of code that does that:
> $everything = $sheet->UsedRange()->{Value};
> for (@$everything)
> {
> for (@$_)
> {
> print defined($_) ? "$_|" : "<undef>|";
> }
>
> print "\n";
> }
>
> However, I don't understand what @$everything and @$_ are; arrays,
> arrays of arrays, hashes? It looks like the entire spreadsheet goes
> into $everything, which is more confusing since it is a scalar. I'd
> like to extract the second and fifth elements of a row and create a
> hash out of them.
>
> On another note, I have to run my script three times to get it to
> work. The first time it doesn't run at all, the second time it hangs
> and the third time it works properly. I assume this is a function of
> the code that starts/stops the excel application (the spreadsheet
> only becomes visible on the third try). Any ideas on this?
>
> Thanks!
>
> ______________________________________________________________
> Steve Gross Tel:
> 212-284-6558
> Director of Information Technology Cell:
> 917-575-4028
> JESNA Fax:
> 212-284-6951
> www.jesna.org
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>