LWN.net Logo

On the future of Perl 5

On the future of Perl 5

Posted Dec 3, 2008 16:21 UTC (Wed) by orev (subscriber, #50902)
Parent article: On the future of Perl 5

Perl is not on the decline. In fact, it has reached the point of ubiquity and is thus becoming invisible. Perl is on every Linux system, and a large number of tools are written in it. It's been around for a long time, so it's not as exciting as all the newcomers, but that's because it's well-understood and stable. The newcomers are exciting because they have not reached the same level of maturity.

Perl is akin to a mainframe... people think it is a dinosaur, but in reality it is the workhorse that is so stable that you don't need to mess with it anymore and can just focus on the actual work that needs to get done, and it gets done reliably. I don't expect you whippersnappers to understand that, but once you've been in IT for 10 years or more, and with the right attitude, you eventually will.


(Log in to post comments)

On the future of Perl 5

Posted Dec 3, 2008 17:41 UTC (Wed) by jordip (guest, #47356) [Link]

In my system (Ubuntu 8.10 desktop with some random development packages):

locate *.pl | wc -l
731

locate *.py | wc -l
11378

locate *.rb | wc -l
2454

On the future of Perl 5

Posted Dec 3, 2008 17:47 UTC (Wed) by tzafrir (subscriber, #11501) [Link]

python modules are .py . Perl modules are .pm and not .pl .

Here:

$ locate *.pl | wc
2332 2332 159535

$ locate *.pm | wc
2652 2652 159667

$ locate *.py | wc
13245 13245 759199

$ locate *.rb | wc
545 545 21072

(From my Debian Lenny system with a similar role)

On the future of Perl 5

Posted Dec 3, 2008 18:18 UTC (Wed) by drag (subscriber, #31333) [Link]

This is a fairly fresh Fc10 install.

locate *.pl |wc
609 610 29121

locate *.pm |wc
604 604 28603

locate *.py |wc
4506 4506 256033

locate *.rb |wc
5 5 285

On the future of Perl 5

Posted Dec 3, 2008 18:30 UTC (Wed) by kragil (subscriber, #34373) [Link]

The amount of perl scripts in modern distros is declining. I think Red Hat and Canonical with their strong Python focus will be the first companies to phase out Perl in their base distros ( might take a few more years, but reimplementing/developing new in Python is the sane choice. Porting to Perl6 isn't IMHO ).

On the future of Perl 5

Posted Dec 4, 2008 8:55 UTC (Thu) by job (guest, #670) [Link]

I don't think the number of files with a particular extension is the question.

A better metric may be:
$ file /usr/bin/* | grep perl | wc -l
97
$ file /usr/bin/* | grep python | wc -l
80

(Repeat through $PATH.) At least on Ubuntu Intrepid this shows them on roughly equal footing.

On the future of Perl 5

Posted Dec 4, 2008 15:19 UTC (Thu) by hummassa (subscriber, #307) [Link]

Solving the dispute with a little Perl script :-)
#!/usr/bin/perl

use strict;

my %languages;
for( grep !m{^/home}, split /:/, $ENV{PATH} ) {
  for( <$_/*> ) {
    $_ = do { <F> if open F, '<', $_ };
    next unless /^#!/;
    $languages{$1}++ if /\b(perl|php|python|ruby)\d*\b/
  }
}
printf "%-20.20s  %6d\n", $_, $languages{$_} for sort keys %languages

__END__
Output (on my Kubuntu 8.04):

perl                     891
php                        2
python                   242
ruby                      40

On the future of Perl 5

Posted Dec 5, 2008 21:59 UTC (Fri) by cdmiller (subscriber, #2813) [Link]

I'm still waiting for the "equivalent" Python script to appear :)

On the future of Perl 5

Posted Dec 6, 2008 5:47 UTC (Sat) by dmag (subscriber, #17775) [Link]

Oh, please, let's not have a language flame war on LWN.

Besides, Ruby is much better :)

#!/usr/bin/ruby

is_home = lambda {|path| path =~ /^\/home/ }

languages = Hash.new(0) # Default value is zero

ENV['PATH'].split(/:/).reject(&is_home).each do |one_path|
  Dir[one_path + "/*"].each do |binfile|
    File.open(binfile,"r") do |data|
      first_line = data.gets
      languages[$1] += 1 if first_line =~ /\b(perl|php|python|ruby)\d*\b/
    end rescue puts "#{binfile} unhappy"
  end
end

languages.each_pair do |language, count|
  puts "%-20.20s  %6d" % [language, count]
end

__END__
Output from Slackware 12.0 (with lots of rubygems installed):
php                        1
python                    62
ruby                      79
perl                     203

For comparison: (sh|bash|tcsh|csh|ash|ksh|zsh|fish)
sh                       488
bash                      22
ksh                        1
csh                        1

Of course, we're not really measuring anything useful here. For example, git used to install tons of commands in /usr/bin. This could tilt the scales (if it were written in one language).

Seriously, I doubt that Ruby (or even Python) will unseat Perl from it's sysadmin tool niche, which is what we seem to be measuring here. Since every distro has bash and perl, that's what people tend to use.

On the other hand, I think Ruby (and perhaps Python) has already unseated Perl from web scripting, where the client doesn't care what language the server is written in.

On locate

Posted Dec 3, 2008 20:01 UTC (Wed) by rfunk (subscriber, #4054) [Link]

The locate command isn't a good way to measure how much of any given
language there is on your system, since file extensions don't need to be
used. That is, not all Perl scripts end in .pl (or .pm), not all Python
scripts end in .py (or .pyc), and not all Ruby scripts end in .rb. On top
of that, the files most likely to end in those extensions are support
files, inflating the numbers.

On the future of Perl 5

Posted Dec 7, 2008 18:22 UTC (Sun) by oak (subscriber, #2786) [Link]

Lintian warns if script has extension, so it's unlikely any of the
Perl/Python/Ruby/... scripts in Debian or derived distros have extensions.
Only things like Python modules (under lib/) have extensions, not the
scripts themselves.

On the future of Perl 5

Posted Dec 3, 2008 19:19 UTC (Wed) by smoogen (subscriber, #97) [Link]

Well as a fellow old fart.. I can say that the mainframes are going away as fast as people hit retirement age. Its as if the mainframe is the gated retirement community. There aren't a lot of them and they are expensive when they go down so only the experienced people are allowed on them.. and the new people play with this Linux stuff... and all the paycheck software that was on the mainframe is moved over to the Linux systems for what 1 month of support from IBM etc cost.

The same is the way for any language.. yes it is ubiquitous and will be around for a long time, but eventually it becomes a Fortran or Cobol. The community is a small set of people who used it in its heyday and a smaller crowd of people who are "accepted" into the Secret Brotherhood. And eventually the decline becomes terminal where only people in a certain set ever really know the language anymore.

One could say this is natural course of events for computer languages.. they are born, grow, become mainstream, retire, and then spend their final years sitting on their front porch yelling at the kids to get off their lawn. Some sadly spend their last years in a nursing home with tubes stuck up every orifice because the kids are living off their pension checks.

On the future of Perl 5

Posted Dec 3, 2008 20:21 UTC (Wed) by muwlgr (guest, #35359) [Link]

Interesting is that Unix shell and its variations seems not going into decline. Unlike some JCL/DCL etc. Very few people try to replace /bin/sh with something else. Even csh/tcsh were not so successful. bash/ksh/zsh are extensions, they still have common subset standardized by POSIX (may be that's the catch?).

On the future of Perl 5

Posted Dec 4, 2008 11:58 UTC (Thu) by jonth (subscriber, #4008) [Link]

Not true: On Debian Etch:

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2006-12-20 00:07 /bin/sh -> bash

On Ubuntu Hardy:

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-04-24 23:50 /bin/sh -> dash

(They replaced bash with dash for speed reasons, IIRC)

On the future of Perl 5

Posted Dec 4, 2008 14:30 UTC (Thu) by muwlgr (guest, #35359) [Link]

Yes but these shells still implement /bin/sh functionality as set in POSIX.

On the future of Perl 5

Posted Dec 3, 2008 19:57 UTC (Wed) by sbergman27 (guest, #10767) [Link]

"""
Perl is not on the decline. In fact, it has reached the point of ubiquity and is thus becoming invisible.
"""

The percentage of scripts in /usr/bin and /usr/sbin which are perl scripts on a Fedora Core 1 server I manage is about 35%. Checking a similar installation of F8, it's less than 25%. This certainly does not support that assertion... except for maybe the "becoming invisible" part. ;-)

On the future of Perl 5

Posted Dec 4, 2008 15:03 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

Atleast for the Fedora Live CD, there has some people looking to see, if we can drop the perl dependency since it occupies considerable amount of space which could be used for more useful purposes. So you are right but it probably will take more time for that to happen.

On the future of Perl 5

Posted Dec 7, 2008 18:19 UTC (Sun) by oak (subscriber, #2786) [Link]

> there has some people looking to see, if we can drop the perl dependency
since it occupies considerable amount of space which could be used for
more useful purposes

At least in Debian, the "perl-base" package (which is an essential, Perl's
POSIX standard utility...) containing the Perl interpreter / core stuff is
only <2MB. It's all the extra modules etc in "perl" package that take
>10MB space. But that's not an essential package.

On the future of Perl 5

Posted Dec 11, 2008 19:51 UTC (Thu) by biged (subscriber, #50106) [Link]

> Perl is on every Linux system

Not the OLPC, I think:
http://wiki.laptop.org/go/Ask_OLPC_a_Question_about_Softw...

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds