in reply to Re^3: Parsing with RegEx into Array
in thread Parsing with RegEx into Array

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^5: Parsing with RegEx into Array
by ikegami (Patriarch) on Jun 25, 2010 at 22:19 UTC

    For the match operator. "/s" causes "." to match any byte/character. Without it, "." matches any byte/character except 0x0A/newline. Operators are documented in perlop. There's probably more info perlre.

    open(my $fh_in, '<:encoding(UTF-8)', ...) or die ...; ... my @allItems = $file_in =~ m{<item>(.*?)</item>}sg; ... open(my $fh_out, '>:encoding(UTF-8)', ...) or die ...; print $fh_out ...;
      Is that the same thing I have for writing file. The code that is commented.
Re^5: Parsing with RegEx into Array
by Corion (Patriarch) on Jun 25, 2010 at 22:16 UTC

    You never check whether opening the output file succeeded. See open. For your original query about regular expressions, see perlre and maybe perlretut.

    A reply falls below the community's threshold of quality. You may see it by logging in.