$everything is a scalar reference to an array.  You can dereference the
array with the '@$everything' notation or the '@{$everything}' notation.
(The second one removes any ambiguity about the reference, but 99% of
the time the first way is okay.)

You can access elements of the array by either doing this:

   ${$everything}[0];

or this:

   $everything->[0];

The second way is easier to read for most people.


This also works for hashes.

   my $hash = {name => 'Tim', age => 29};

   print keys %{$hash};

   print $hash->{age};


As for the second question, you would have to show us more of your code
to be sure.





-----Original Message-----
From: Stephan Gross [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 28, 2006 3:44 PM
To: beginners@perl.org
Subject: Reading Excel spreadsheet into variables

<snip>

However, I don't understand what @$everything and @$_ are; arrays,
arrays of arrays, hashes?  
<snip>
 
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!

<snip>

 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to