in reply to array element question

my @new = join($array[$i], $array[$i++]);

Be very careful with that. Who knows when the ++ will happen in relation to the array accesses! (I think you can guarantee that it will happen before the second one, but how about in relation to the other?

Replies are listed 'Best First'.
Re^2: array element question
by robot_tourist (Hermit) on Nov 22, 2006 at 14:26 UTC

    probably best not to use assignments in array access. You'll need another line of code to do the increment, but I think it's worth it.

    How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
    Robot Tourist, by Ten Benson