perl.beginners
[Top] [All Lists]

Re: Concatenating Strings

Subject: Re: Concatenating Strings
From: Bobby
Date: Tue, 25 Mar 2008 10:31:12 -0700 PDT
Newsgroups: perl.beginners
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.
<Prev in Thread] Current Thread [Next in Thread>