Try
$bar3 =~ s/(.)(?!\z)/$1\t/g;
i.e. for every character except the last one (-> (?!\z)), replace it with itself plus a tab.
(What your substitution would do is remove a trailing tab.)
In reply to Re: Substitute: for having tabs between the characters
by almut
in thread Substitute: for having tabs between the characters
by snape
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |