in reply to Join with more than one EXPR

You received some good answers so I won't bother trying. I will however offer a pieces of advice.

Don't use one letter variable names for anything other loop variables, e.g. for my $i ( 0 .. 5 ).

Don't use $a or $b for anything other than a sort subroutine.