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
In reply to Re: adding ";" to void elements
by johngg
in thread adding ";" to void elements
by steph_bow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |