Some things about Perl that keep me coming back or I just appreciate.
- THE BEST regex syntax, which basically was inherited from awk/sed and the like. I am puzzled that while Ruby smartly has "=~" they didn't include the substitution syntax form "s/.../.../g" which is so common, ingrained, and best of all, compact. WHY WHY WHY?!! I mean, Ruby can still keep the sub() and gsub() (so as not to munge in-place). This is why I still use Perl for all of my command-line hacks [perl -pe] instead of Ruby. BTW, Python's regexps suck balls.
- Variables are easily identifiable because ALL variables begin with a $ or @ or %. Since Ruby is OO and has good data structures, only one symbol would be needed, say the $ (which means global in Ruby though). When I first learned Perl, the constantly having to type $, I admit, was kind of annoying. But I learned to appreciate it.
- Because of the regex syntax and the "everything is a string" paradigm, it really is nice and convenient to quickly manipulate strings which is what I spend a good chunk of the time doing at work.
No comments:
Post a Comment