perl - Concatenating elements from two arrays of same indexes -


i facing issue while concatenating elements of indexes 2 arrays.

example:

 @x=(1,2,3,4);  @y=(5,6,7,8); 

i want concatenate

$x[0]"_"$y[0] 

like this:

if @i=(..n), $x[$i]"_"$y[$i] 

suggest possible solution.

to repeat process n elements in array, can following

my @x=(1,2,3,4); @y=(5,6,7,8);  @concatenated_array=(); $i (0 .. $n)      # define $n <= min($#x,$#y) {   push @concatenated_array, $x[$i] ."_". $y[$i];  } print "@concatenated_array\n";  

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -