![]() |
|
The stupid question is the question not asked | |
PerlMonks |
s///g and capturing all matchesby Random_Walk (Prior) |
on Dec 15, 2011 at 14:18 UTC ( #943738=perlquestion: print w/replies, xml ) | Need Help?? |
Random_Walk has asked for the
wisdom of the Perl Monks concerning the following question:
good $localtime fellow monks, I am tearing my hair out over a small oddity. Why will this work:
But this behaves so differently
I am trying to extract comments from a file I have in a buffer read in with local $/;. The comments are marked by a ; and continue to the end of the line. For various reasons I want the file as a sinlge line and want to extract the comments. The comments will be added back in later so I substiture them for a marker. I realise I could break the file into lines and put it back together again later but I would love to be able to do it in one line Cheers,
Pereant, qui ante nos nostra dixerunt!
Back to
Seekers of Perl Wisdom
|
|