perl

Is Perl the best solution to write code that needs setuid?

A bunch of searching the web for things related to setuid and shell scripts lead me to this answer in Stack Exchange:

Perl explicitly supports setuid scripts in a secure way. In fact, your script can run setuid even if your OS ignored the setuid bit on scripts. This is because perl ships with a setuid root helper that performs the necessary checks and reinvokes the interpreter on the desired scripts with the desired privileges. This is explained in the perlsec manual. It used to be that setuid perl scripts needed #!/usr/bin/suidperl -wT instead of #!/usr/bin/perl -wT, but on most modern systems, #!/usr/bin/perl -wT is sufficient.

There was a comment on that answer suggesting the situation had changed recently, but the Perl docs assure me it still works.

Why PHP’s RegEx Is Slow, And What You Can Do About It (if you happen to be a committer on the PHP project)

Regular Expression Matching Can Be Simple And Fast, by Russ Cox:

Perl [and PHP and others] could not now remove backreference support, of course, but they could employ much faster algorithms when presented with regular expressions that don’t have backreferences.

How much faster? About a million times (no, I do not exaggerate).

I use a lot of regular expressions, and relatively few of them use backreferences. It’d be worth optimizing.

Web Development Languages

David Cloutman pointed to Craiglist’s job ads as an indicator of programming language popularity. Here’s the hit counts for “web design jobs” and “internet engineering jobs” in the Bay Area:

<td>
  PHP
</td>

<td>
  Java
</td>

<td>
  Ruby
</td>

<td>
  Python
</td>

<td>
  PERL
</td>
<td>
  167
</td>

<td>
  246
</td>

<td>
  85
</td>

<td>
  98
</td>

<td>
  109
</td>
<td>
  110
</td>

<td>
  71
</td>

<td>
  22
</td>

<td>
  19
</td>

<td>
  31
</td>

<td>
</td>
 
internet engineering jobs
web design jobs

Cloutman has a few ideas for what the numbers mean, but I’m just entertained by the data. (Note: he corrected his original numbers.)