in reply to Parsing Quark file with RegEx
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<\$>/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing Quark file with RegEx
by ikegami (Patriarch) on Sep 03, 2004 at 21:09 UTC | |
by rael9 (Novice) on Sep 03, 2004 at 21:15 UTC | |
by ikegami (Patriarch) on Sep 03, 2004 at 21:23 UTC | |
|
Re^2: Parsing Quark file with RegEx
by rael9 (Novice) on Sep 03, 2004 at 20:56 UTC |