in reply to Populating a hash from array

@array1 = qq (foo, foo1, foo2, foo3, foo4, ...) @array2 = qq (bar, bar1, bar2, bar3, bar4, ...).
As a sidenote, you don't want qq, you want qw. And get rid of the commas.
@array1 = qw(foo foo1 foo2 foo3 foo4 ...); @array2 = qw(bar bar1 bar2 bar3 bar4 ...);

Replies are listed 'Best First'.
Re: Re: Populating a hash from array
by TASdvlper (Monk) on Jan 07, 2004 at 15:05 UTC
    thanks ... probably just a typo on my part.
      TASdvlper,
      In addition to what bart said, if your data really does look like this - there is probably a much better way to build your array (the lazy way).
      my @array1 = map { 'foo' . $_ } 1 .. 99;
      "Ok great, but I want the first element to just be 'foo' with no number"
      my @array1 = map { $_ ? 'foo' . $_ : 'foo' } 0 .. 99;
      Cheers - L~R