Re:In Praise of Perl 5
by wting on Thursday February 27, 2014 @07:54PM
(#7316549)
Are you aware of sh? http://amoffat.github.io/sh/
[ Parent
| on HN ]
Its not about having function to call shell commands. That way I might as well use C or C++ or Java.
Its about how such a feature interplays with rest of the language.
Frankly speaking in Python it looks like added after a lot after thought and a lot of reluctance. Same with regular expressions.
Yeah, it's not just about shelling out, but about being able to write Perl that works sort of like an awk script, just with more of a real language attached to it. Functions that implicitly work on the current line, lightweight regex syntax, the <FILE> magic, bash-style file tests (-e/-r/-d/-f), etc.
And the Haskell equivalent for a performance and type safety boost: