3 ms·
Ditto - I use sed/awk daily, but I never write Perl any more (though I do use older bash scripts that call Perl under the hood). I'm still comfortable recommen
by nmfisher 3y ago
Ditto - I use sed/awk daily, but I never write Perl any more (though I do use older bash scripts that call Perl under the hood).
I'm still comfortable recommending people learn sed/awk but I don't think I'd recommend learning Perl* now. It sits in an awkward spot between the simplicity of GNU utils and the expressivity of a scripting language, but doesn't do either of those things better than the equivalent sed/Python etc.
FWIW I still write Bash scripts on a daily basis, too.
* that's no comment on Raku, which I consider a separate beast.
- 77pt77 3y ago> simplicity of GNU utils and the expressivity of a scripting language, but doesn't do either of those things better than the equivalent sed/Python etc. It does scripting and gluing scripts far better than python. It's not even close. I'm not even going to address sed, awk, bash and the like.
- em-bee 3y agoif you have a script that makes heavy use of sed, awk, tr and the like, then maybe translating to perl would be most natural. but otherwise a script is either just calling a lot of commands one after the other, for which a shell script is fine. or they do a lot of data mangling without needing many external applications or none even, in which case any other languages besides perl is just as fine.
- 2colours 3y agoJust imagine writing bash incorporating a sed script for something you can do with 20 keystrokes, then migrating the sed part to awk until it reaches 20 lines, then rewrite the whole thing to Python or somehow bridge it to the shell script - when you could have done the whole thing in Perl without feeling that it holds you back...
- 77pt77 3y ago> without feeling that it holds you back This. I always feel like bash and pipes are always holding me back and resisting. Python is just to verbose to exec/pipe/read/write. The real issue is the it's really easy to shoot yourself in the foot with perl.