Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Parsing with RegEx into Array

by mr_p (Scribe)
on Jun 25, 2010 at 22:09 UTC ( [id://846616]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://846616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found