by softbuilder · 18y ago · 0 comments
> insert the same bug into the X programs.
raise an eyebrow. In my experience the platform and language determine what the what the bugs will be. Said more simply: You aren't going to have the same bugs in Perl that you will in Python, and vice versa. Certainly you could, but typically you won't.
Also, the biggest problem with Perl isn't the language per se, it is the entrenched culture which is inclined to abuse of power and unclear coding, often in the name of "efficiency".
Still, Python drives me nuts daily with small things. I can't think of a language or platform that doesn't. Better yes, but not at a level to pick on Perl.
Oh, and I'm rusty but I'm pretty sure that regex is wrong.
So it should be /(.X?<!--)(..X?)-->(.X$)/ instead.
(Note I am using X as asterix because HN at the time of this writing converts asterisks to italics tags.)
But other than that the Perl is perfectly fine. And it is easily readable if you know Perl.
print $_ . "\n" foreach ((<>) =~ /<!--(..*?)-->/g);