The regex machine

One of the advantages of working with Perl (instead of Python) is how logical you can make a regex. If you want to match a letter in a word (because you might have it as an option to a sub) you can just do $word =~ /x/

Not the most impressive of function, but how much easier is it to read $word =~ /x/ than┬áre.match(“.*x.*”, word), when Python’s regex engine isn’t even included by default. What’s more, it becomes even more cluttered as a condition statement:

if ( /x/) # using $_
if (re.match(“.*x.*”, word))

Even if no language is good for everything, Perl has proven to be useful in he largest spectrum of applications, as well as being one of the clearest (very little clutter, consistent syntax, easy flow control).