in reply to Re^4: Perl one-liner for array at bash shell
in thread Perl one-liner for array at bash shell

perl -naF, -le '$"=",";print "@F[0..$#F-1],$_" for split/[;\s]+/,$F[-1 +]'
see $" and Slices

Replies are listed 'Best First'.
Re^6: Perl one-liner for array at bash shell
by Anonymous Monk on Aug 22, 2017 at 22:00 UTC
    Same but shorter
    perl -naF, -le '$"=",";print"@F,$_"for split/[;\s]+/,pop@F'