in reply to adding ";" to void elements

This works for two, one or even zero elements.

use strict; use warnings; print map { qq{@{ [ join q{;}, @{ $_ } == 3 ? ( @{ $_ } ) : ( @{ $_ }, ( q{} ) x ( 3 - @{ $_ } ) ) ] }\n} } map { chomp; [ split m{;} ] } <DATA>; __END__ a;3 b;2;3 c;5;4 d;6 f

The output.

a;3; b;2;3 c;5;4 d;6; ;; f;;

I hope this is useful.

Cheers,

JohnGG