News for hackers. Stuff that matters.
Re:Libc on macOS invokes Perl as a subprocess for string pro... by fit2rule on Wednesday January 16, 2019 @08:06AM (#18920458)
I find it hard to believe that there's any software out there that doesn't, eventually, invoke Perl as a subprocess .. I mean, its Perl.
Re:Libc on macOS invokes Perl as a subprocess for string pro... by leejo on Wednesday January 16, 2019 @08:20AM (#18920563)
That's essentially what the OG tweet is saying: Pinnacle of software development: you can solve the problem with three lines of Perl, but you don’t, because of a non-argument against Perl. Since there didn't used to be that many arguments against perl/Perl it worked its way into a lot of systems even if it wasn't actually implementing the system.

Of course Perl, having fallen out of vogue, probably wouldn't be used today but it used to be everywhere so its footprint is still pretty large.

Also - I can't help but see the irony in shelling out to perl given experienced Perl developers always tell the less experienced ones to avoid shelling out from Perl if possible and to only do that as a last resort if there isn't an existing library to solve the problem.

Re:Libc on macOS invokes Perl as a subprocess for string pro... by virgilp on Wednesday January 16, 2019 @10:23AM (#18921560)
> experienced Perl developers always tell the less experienced ones to avoid shelling out from Perl if possible

The reason for that is obvious, right? By induction, shelling out from Perl would only result in the called process shelling back to Perl. So it's much better to just call that Perl code directly.

Re:Libc on macOS invokes Perl as a subprocess for string pro... by rurban on Thursday January 17, 2019 @04:38AM (#18929521)
Only loud-mouthed inexperienced middle managers tell their juniors to follow NIH and do everything in pure perl. It's pure fear to be broken by changed dependencies.

More experienced managers tell their devs to shell out to standard tools like sh, wget, curl, dig, mysqlclient and not use the builtin pure-perl libs. The tools are much better, the code is 10x smaller and faster, and you are getting updates for free (e.g. ssl). Even in C I very often call system("wget http://...") and avoid libcurl.

Re:Libc on macOS invokes Perl as a subprocess for string pro... by leejo on Thursday January 17, 2019 @04:48AM (#18929557)
Only loud-mouthed inexperienced middle managers tell their juniors to follow NIH and do everything in pure perl. It's pure fear to be broken by changed dependencies.

It's not NIH if you're advocating using CPAN modules or existing libraries.

Sure, use the right tool - but don't advocate to juniors a method that can lead to OS command injection because they're not experienced enough to know to, or how to, sanitise their inputs.