Please show us the expected output and what you got for a short example input.
See also SSCCE
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
After reading brainfuck I'm understanding your problem is that you are inserting + symbols as c-code which is replaced later as BF code.
Translating linear code with a series of global s///g substitutions rarely works, because you are running over your own output.
But Anonymous Monk has already given you an excellent answer in the meantime.
In reply to Re: Weird substitution, missing output
by LanX
in thread Weird substitution, missing output
by timpoiko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |