in reply to Parsing Quark file with RegEx

UPDATE! I fixed it finally. What happened was that after the first three Regex search and replaces, the <Bz8> was technically right next to the text following it, but as it was in the @FILE array still, and they were in different nodes in the array, they were being treated separately. I fixed it by printing @FILE out to a "working" file, reading it back in to @FILE so that the line breaks were now updated in the array, and then doing the final Regex search and replace. There's probably an easier way, but being relatively new to Perl and having been out of the programming loop for quite some time now, I was just happy to get it working. Thanks for all the help, folks!

Replies are listed 'Best First'.
Re^2: Parsing Quark file with RegEx
by Eimi Metamorphoumai (Deacon) on Sep 07, 2004 at 20:08 UTC
    The easier way to do it, if I'm reading what you want correctly, would be
    @FILE = split(/\n/, join('', @FILE));
    which concatentates all the items into one big string, then splits it on newlines.