Hoot has asked for the wisdom of the Perl Monks concerning the following question:
A Beautiful Poem
Mary had a little lamb, little lamb, little lamb
Mary had a DOG but everywhere that mary went the lamb was
sure to go even though it did not like the dog very much.
Is it possible to have DOG as the pattern to match and store everything before it in a variable and everything after it in another variable?
I have tried $` and $& and $' but can't get my head around the new lines etc.
I want to be able to capture the title of the poem and the poem itself and DOG.
Can somebody help me please?