|
|
Thanks for all your input, using a hash does make things a lot easier for me.
Rob Dixon <rob.dixon@xxxxxxx> wrote: kens wrote:
>
> # Or if you must use a counter
>
> my $count = 0;
>
> while ( defined($strA[$count]) )
> {
> print "$strA[$count++]\n";
> }
for my $count (0 .. $#strA) {
print "[$count] = $strA[$count]\n";
}
**OR**
my $count = 0;
foreach (@strA) {
print "[$count] = $strA[$count]\n";
$count++;
}
Rob
--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
http://learn.perl.org/
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
|
|