3 ms·
The problem is that awk is a very simple language, which you can learn in an afternoon. Perl is a very complex language, and is not used anymore, so you're jus
by coliveira 5y ago
The problem is that awk is a very simple language, which you can learn in an afternoon. Perl is a very complex language, and is not used anymore, so you're just spending your time on something you'll rarely use.
- forinti 5y agoIf you work a lot with Linux, you can pretty much count on Perl and awk always being there. So it comes in quite handy to know them.
- mhd 5y agoThe part that's equivalent to what you'd use for your regular awk isn't very different. Sure, you can do full-scale OO programs, but that doesn't have a large impact on small string munging. I get that you might not learn it to fluff up your CV. Also, it's usually the same kind of Perl, so you don't have to worry about whether awk is the "one true" one, or mawk, or gawk...
- sigzero 5y agoPerl is very must still used. lol
- thesuperbigfrog 5y ago>> Perl is a very complex language, and is not used anymore, so you're just spending your time on something you'll rarely use. Perl is no more complex than Python, Ruby, or Powershell. If you use any of those you can be productive with Perl in a few hours. Perl is still used, it is just not as popular as it was in the past. Do you use Git? Parts of it are written in perl. Large parts of Git were originally written in Perl, but have been migrated to C over time.
- chasil 5y agoOpenBSD's binary package system is written in perl.
- throwawayboise 5y agoProbably as much for legacy reasons as anything else. Perl was the chosen scripting language for utilities, it works, they understand it, and they've kept with it. Sort of how they stay with CVS for their source repository. Python isn't even installed on a base OpenBSD system.
- chasil 5y agoMark Espie rewrote the entire package system in perl in 2010, which is a bit late to be classed as legacy. https://undeadly.org/cgi?action=article;sid=20100323141307 https://undeadly.org/cgi?action=article;sid=20100323141307 I'm not sure what was used for the version before this, but the original BSD package system was written in C.
- throwawayboise 5y agoBut perl was already the "standard" for other system/config utilities, no?
- chasil 5y agoI don't know what we mean by "standard," but I found a number of perl references with the following shell fragment: $ for x in $(echo $PATH|sed 's/:/ /g'); do file $x/*|grep perl;done All but two hits were in /usr/sbin, and /usr/bin. I isolated those files with: $ file /usr/sbin/* | awk '/perl/{sub(/:.*/,"");sub(/^.*[/]/,"");printf "%s, ", $0}';echo '' The sbin results are: adduser, fw_update, pkg_add, pkg_check, pkg_create, pkg_delete, pkg_info, pkg_mklocatedb, pkg_sign, rmuser, There are more in /bin: $ file /usr/bin/* | awk '/perl/{sub(/:.*/,"");sub(/^.*[/]/,"");printf "%s, ", $0}';echo '' c2ph, corelist, cpan, enc2xs, encguess, h2ph, h2xs, instmodsh, libnetcfg, libtool, perl, perlbug, perldoc, perlivp, piconv, pkg-config, pl2pm, pod2html, pod2man, pod2text, pod2usage, podchecker, podselect, prove, pstruct, skeyprune, splain, streamzip, xsubpp, A perl script can't pledge() or unveil(), so I am guessing that anything sensitive has moved to C.
- selfhoster11 5y agoIt's used in Debian system tools and in Git, so it's still in wide use.