Welcome to the monastary, 4perl
. It looks like you have the rough idea in place -- what about the above code doesn't work? Please see How do I post a question effectively?
. In particular, please post a chunk of your literal input, wrapped in <code>
tags, as well as your expected output. Also, what is in $lines
? Did you slurp in the entire file ($/
), which is what I'd expect from your code, or are you parsing line-by-line? A little more context would be helpful.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.