[Buffalo-pm] Question: How to iterate through 2 arrays and merge columns

Jim Brandt cbrandt at buffalo.edu
Thu Jul 7 04:49:49 PDT 2005


You still have commas in here, so it's not creating one big string.  
You need to convert all of the commas to periods, including the ones  
after the "\t". If you fix that, I think you should be all set.

As far as your 'our' problems, here's the snippet from the docs:

An "our" declares the listed variables to be valid globals
                within the enclosing block, file, or "eval".  That  
is, it has
                the same scoping rules as a "my" declaration, but  
does not cre-
                ate a local variable.

The trick is "within the enclosing block," which in your case was the  
'for' loop. In general, most normal programs never need 'our'. You  
should just just 'my', and watch out for the scoping issue you ran into.


On Jul 7, 2005, at 5:48 AM, Shankar, Ganesh wrote:

>         push( @red_elements,
>                 $red_items[6]. "\t", $red_items[7]."\t",
>                 $red_items[8]. "\t", $red_items[9]. "\t"
>         );

==========================================
Jim Brandt
Administrative Computing Services
University at Buffalo



More information about the Buffalo-pm mailing list