I think you were confusing grep (used to filter) with map (used to transform):
@FILE2 = map { local $_=$_; s/(<Bz8>)([^ ]*)/$1$2<\$>/; $_ } @FILE;
You can also do the change in place:
s/(<Bz8>)([^ ]*)/$1$2<\$>/ foreach (@FILE);
or
foreach (@FILE) { s/(<Bz8>)([^ ]*)/$1$2<\$>/; }
In reply to Re: Parsing Quark file with RegEx
by ikegami
in thread Parsing Quark file with RegEx
by rael9
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |