On Tue, 17 Jul 2001, Evan Panagiotopoulos wrote:
> I have an array of X elements and I want to go from the first element
> (is it zero?) to the last. I have a variable containing the number of
> elements in the array. If the array has 22 elements does it go from 0
> to 21 or 1 to 22?
foreach doe
Evan Panagiotopoulos wrote:
>
> I am trying to learn the foreach loop. Is there a place on the web where there are
>examples for the foreach? Basically I have an array of X elements and I > want to go
>from the first element (is it zero?)
Yes!
> to the last. I have a variable containing the
Sounds interesting. Please verify this link.
-- Original Message --
From: "Jos I. Boumans" <[EMAIL PROTECTED]>
Date: Sun, 8 Jul 2001 11:19:21 +0200
>
>you might find the loops/block tutorial i wrote on
>www.sharemation.com/~perl/tut helpfull
>
>regards,
>
opoulos" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
"Jos I. Boumans" <[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 4:39 PM
Subject: Re: foreach examples/usage
> Sounds interesting. Please verify this link.
> -- Original Message -
you might find the loops/block tutorial i wrote on
www.sharemation.com/~perl/tut helpfull
regards,
Jos Boumans
I am trying to learn the foreach loop. Is there a place on the web where
there are examples for the foreach? Basically I have an array of X elements
and I want to go from the first e
Evan wrote:
> I am trying to learn the foreach loop. Is there a
> place on the web where there are examples for the
> foreach?
There's good, quick example on Perl Monks:
http://www.perlmonks.org/index.pl?node=foreach%20loops&lastnode_id=954
> Basically I have an array of X elements and
> I want
The first place in your array is 0, There are a couple of examples of
foreach that I don't mind giving:
my @array = qw{this is the example of the array we will use for this
example};
foreach(@array) {
print $_."\n"; # current element is $_
}
or if you need the index of