perl.beginners
[Top] [All Lists]

Re: Concatenating Strings

Subject: Re: Concatenating Strings
From: Rob Dixon
Date: Tue, 25 Mar 2008 01:59:20 +0000
Newsgroups: perl.beginners


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

<Prev in Thread] Current Thread [Next in Thread>