perl -le 'print $_ for split( /([A-Z])/, shift)' AbcDefGhi A bc D ef G hi