@ids = (32,36,38,34,35); @bg = trans_id_array(\@ids,$varpar1,$varpar2); sub psh_trans_id_array { @ids = @{$_[0]}; $var1 = $_[1]; $var2 = $_[2]; foreach (@ids) { $idss .= ",".$_; } }