On 14/11/2010 13:53, Zachary Brooks wrote:
Hey Rob,
Of all the feedback. yours was the one I was able to drop into my code
and make it work, no matter how rudimentary my understanding of Perl is.
Thanks.
You're welcome. I'm glad to be able to help.
As far as the XML libraries, we are supposed to learn to understand how
libraries work by manually going through the process.
OK, but bear in mind that regexes aren't good at matching nested data
like XML. It can be easy to write something that works with a specific
data set, but a solution that will work for any valid XML data will be
much more complex and difficult to implement.
As much as I appreciate the help, I want to understand what I did.
g=global match, i=ignores case, and s=allows the code to jump lines? I
thought the code was naturally greedy. It seems odd.
Almost right. /./ matches any character except newline "/n", so a
pattern like /.*/ will match up to the first newline or the end of the
string, whichever is first. The /s modifier allows /./ to match newlines
as well, so /.*/s will always match right to the end of the string.
Regarding the quotes, I hope the problem disappears but I'll use the q
or qq if needed.
As I said, the problem exists only because you are declaring test data
within your program. Once you are reading from a file the situation will
not exist.
Cheers,
- Rob
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/