Slashdot Mirror


Perl 5.14 Released

chromatic writes "Pumpking Jesse Vincent has just released Perl 5.14, the latest stable version of the venerable Perl 5 programming language. The list of changes in Perl 5.14 includes several enhancements, including performance tuning, Unicode improvements, and updates to the core libraries and documentation. Perl 5.16 is on track for a release next April."

50 of 187 comments (clear)

  1. Re:What about Perl 6? by nysus · · Score: 4, Funny

    I was just going to say that back in about 2001 someone gave me advice not to learn Perl 5 because a Perl 6 release was imminent.

    --

    ---Technology will liberate us if it doesn't enslave us first.

  2. Re:What about Perl 6? by goombah99 · · Score: 4, Informative

    Perl 6 is out. But it's a diffent language in the same way that python 3 is not like py 2.7

    The thing I really like about perl is it's the shortest oreily pocket reference. it's even shorter than c++. Yet you can do vastly more than python without importing a single lib. that is to say it's surprisingly concise for encompassing such a lot of capabilities in the core language.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  3. The question nobody wants to ask.... by cowboy76Spain · · Score: 3, Funny

    .... does it have any new operator? :-P

    And before you tell, it was just a joke, I know you should now add operators in a minor release.

    --
    Why can't /. have a rich-text editor? Editing your own HTML is so XXth century.
    1. Re:The question nobody wants to ask.... by gman003 · · Score: 3, Interesting

      Actually, I've always thought there should be one more common operator - "===". In floating-point context, it would be "approximately equal to", returning true if the arguments are within 10 times the smallest representable value. That would reduce problems with floating-point comparison. Hell, make it work for integers too - it might be useful in PLCs and stuff.

      In a string context (in Perl, it would have to be something besides ===, but we'll get to that later), it would be "visually equal to" - any characters that are visually equal would be considered equal (useful mainly when using Unicode). So the Cyrillic "e" (0435) would be considered equal to Roman "e" (0065). I'm not sure how to handle complexities like "is the single character 'small a with macron' equal to the sequence 'small a' and 'combining diacritic macron'". We'll need a committee for that, probably. And since Perl uses different operators to determine context, we'd need something else for that. "veq", maybe?

      This would, ideally, not just be a Perl construct. I can think of a lot of higher-level languages that could use that. Python. Ruby. Lua. Stuff like that. Lower-level languages probably would be better off without it - C does not need such an operator.

      Just something I've always felt could be useful to have. Sure, there's probably some library that can do those things, but it would be nice to make things simpler.

    2. Re:The question nobody wants to ask.... by dorward · · Score: 2

      This is version 14 of Perl 5. It is a major release. (Perl 6 is a new language)

    3. Re:The question nobody wants to ask.... by elfprince13 · · Score: 2

      This would conflict with "equality without type coercion" in Javascript and PHP.

    4. Re:The question nobody wants to ask.... by gman003 · · Score: 3, Informative
      That reminded me of "Black Perl":

      BEFOREHAND: close door, each window & exit; wait until time.

      open spellbook, study, read (scan, select, tell us);

      write it, print the hex while each watches,

      reverse its length, write again;

      kill spiders, pop them, chop, split, kill them.

      unlink arms, shift, wait & listen (listening, wait),

      sort the flock (then, warn the "goats" & kill the "sheep");

      kill them, dump qualms, shift moralities,

      values aside, each one;

      die sheep! die to reverse the system

      you accept (reject, respect);

      next step,

      kill the next sacrifice, each sacrifice,

      wait, redo ritual until "all the spirits are pleased";

      do it ("as they say").

      do it(*everyone***must***participate***in***forbidden**s*e*x*).

      return last victim; package body;

      exit crypt (time, times & "half a time") & close it,

      select (quickly) & warn your next victim;

      AFTERWORDS: tell nobody.

      wait, wait until time;

      wait until next year, next decade;

      sleep, sleep, die yourself,

      die at last

      That's actually valid Perl (only Perl 3, though - it breaks in later versions). And yes, I'm aware most of you have already seen it.

    5. Re:The question nobody wants to ask.... by Eil · · Score: 2

      Er, no it wouldn't because Perl is neither Javascript or Python.

    6. Re:The question nobody wants to ask.... by petermgreen · · Score: 3, Insightful

      The big problem with an approximately equals for floats operator is that it provides no way for the user to specify the acceptable margin of error. So the language designer has to guess a value that they thing is "big enough" to avoid (possibly heavily compounded) rounding errors while not being so big as to cause unwanted matches. IMO that kind of judgement call should be something consciously made by the programmer (and they should be having the releated thought of "should I really be using a floating point type here at all" not something hardcoded into the language.

      Similarly for strings "approximately equals" sounds like a nice idea but it's very hard to define in a robust way. Again probablly not something that should be in the core of a langauge but something provided by a library that can give options on what exactly constitutes approximately equals.

      Finally using === to signify approximately equals seems like a bad idea given that many dynamic languages are using it for something closer to "exactly equals".

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    7. Re:The question nobody wants to ask.... by VortexCortex · · Score: 3, Interesting

      I somewhat agree, however the floating point implementations SUCK at powers of ten -- you should specify epsilon in terms of powers of two. Hell, even my correct decimal text to float/double parsing function is 8 times more complex than the same in hex Why, even C has a hex float/double literal that goes something like this:
      /[+-]?0x[0-9a-f]+\.?[0-9a-f]*p?[+-]?[0-9a-f]*/i )

      The "p" in there stands for "times Nth power of two" similar to the "e" in decimal floats meaning "times Nth power of ten". eg: 0x123p-8 == 0x1.23

      Note, hex decimal places act like decimal's do eg:
      0x1.23 == (dec) 1 + 35 / 256 == 1.13671875 or (hex) 0x1 + 0x23 / 0x100 == 0x1.23

      Specifying floats in the language of the computer's math (binary representable fractions) allows you to actually use equality properly ;-)

      Some of my languages have the === operator already, similar to JS's exact match, perhaps ~=~ or =~= or "approx" would be better?
      I've thought of adding an "approximate" operator -- esp. for physics simulation & game DSLs.

      Although, what's wrong with specifying your required precision? Define your own epsilon (error factor).

      print "$a is approx $b\n" if ( $a > ($b - $epsilon) && $a < ($b + $epsilon) );

      # Compared to:
      print "$a is approx $b\n" if ( $a approx $b );

      # Oh, great, now we need another obscure magic special variable to contain epsilon...
      # Perhaps
      would do? Our English users won't mind using character map...

    8. Re:The question nobody wants to ask.... by kiddygrinder · · Score: 2

      true, but fucking around with that kind of thing between languages is really annoying when you work in both regularly

      --
      This is a joke. I am joking. Joke joke joke.
  4. Re:Meh. by Anonymous Coward · · Score: 2, Funny

    Where do I sign up?

  5. Re:What about Perl 6? by Anonymous Coward · · Score: 2, Informative

    No, Perl 6 is not "out". I can't use it on my production servers, because there's no good implementation yet, even after ten years.

    I know there have been a few attempts, but none of them are seriously usable like Perl 5, Python, Ruby, Tcl, or Lua are.

    At least when developing Python 3, the Pythonistas built a production-grade implementation. Even if its adoption hasn't been as fast as was initially hoped, at least those of us who do want to use it can actually use it, and we can do so for serious uses. The same can't be said about Perl 6.

  6. Re:What about Perl 6? by Tacvek · · Score: 4, Informative

    Perl 6 has 140+ different operators! That is absolutely insane. While I support being concise, Perl has far more complexity in the language core than any other language I have ever seen.

    --
    Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
  7. Re:What about Perl 6? by symbolset · · Score: 3, Insightful

    The more mature a programming language is, the harder it is to extend it. Mature languages have vast codebases that must be supported, and substantive changes break legacy support. That's why it's best to get it right early on.

    --
    Help stamp out iliturcy.
  8. Re:Perl - the COBOL of scripting languages by gman003 · · Score: 5, Insightful

    Perl makes a GREAT "general-administration" tool. I use it as basically bash++ - it's the best way,bar none, to write programs on the command-line. There's a reason even the ultra-minimalist OpenBSD includes Perl in the default install.

  9. Re:What about Perl 6? by bunratty · · Score: 4, Insightful

    Python 3 is barely different from Python 2. It is not backwards compatible, but I've ported Python 3 programs to Python 2 (when I realized I had to use SciPy or run the code on a system with only Python 2), and nearly the only changes I had to make were changes for // for integer division and required () for print -- and these changes were trivial if I could simply import from __future__. In contrast, Perl 6 is very different from Perl 5.

    --
    What a fool believes, he sees, no wise man has the power to reason away.
  10. Perl is alive! by fragermk · · Score: 2

    Perl is alive!

    Last time I checked Slashdot still runs on perl...

    My company does too.

    Now that ActiveState is providing Perl for Cloudfoundry, it's going to be good times in Perl land.

    1. Re:Perl is alive! by rubycodez · · Score: 2, Insightful

      last time I checked the UI of Slashdot was becoming ever more bloated, ugly and less functional. They should ditch the Perl for a modern language while rewriting the whole ball of shit.

  11. Re:Perl - the COBOL of scripting languages by rubycodez · · Score: 2

    I love OpenBSD. But aside from scripts for mucking with perl itself, the reason perl is in the base install is to run the following (mostly brain dead simple) things:

    in /usr/sbin:
    add_user and rm_user scripts
    apxs (apache extension DSO builder / installer)
    pkg_chk, pkg_delete, pkg_info, pkg_create, pkg_merge (our simple and crude package manager)


    in /usr/bin:
    afmtodit font file creator for groff
    c2ph/pstruct dump c structure with offsets from debugger stabs
    find2perl convert find command with args to perl program
    piconv character encoding converter
    sed2p sed to perl converter


    Nothing that couldn't be done better as a side effect to a rewrite to more modern and alive language, the apxs, package manager and add/delete user is probably the only things most people use beside some that might use the apache extension handler. That package manager is especially aching for better features anyway.

  12. Re:Perl - the COBOL of scripting languages by dskoll · · Score: 3, Interesting

    We still use Perl to develop our products (commercial and open-source.) Perl may be maligned, but it's still a good tool for a lot of purposes and if you pick and choose carefully, CPAN is an awesome resource. Perl has modern frameworks (eg, Catalyst) for Web development that are competitive with anything out there, and DBI is superior to most alternative languages' database libraries.

    While I'm bullish on Perl 5, I'm not so optimistic about Perl 6. I think it's suffring horribly from second system syndrome and may never see the light of day as a useful production tool.

  13. Re:Perl - the COBOL of scripting languages by rubycodez · · Score: 2

    but, as with COBOL, that momentum is running down while with other scripting languages things are heating up. I like a language where the attention of the found and key developers are focusing on what will be used in the near future, not flying off into lala land for a decade speaking to each other in isolation.

  14. Re:Perl - the COBOL of scripting languages by jimmydigital · · Score: 4, Insightful

    Excellent troll... really first rate. Did you get federal funding from the Ministry of Trolling for that gem? I've been working professionally in unix/linux environments for about 12 years and believe me perl is still quite alive and well doing real work in lots of different kinds of companies. Php is somewhat painful to code in by comparison but both have their place. Except for java.. it has no sane place but you still find it in use everywhere which just goes to show anything can succeed in this world with enough marketing dollars behind it.

    --
    Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats. -HLM
  15. Re:What about Perl 6? by arth1 · · Score: 2

    With Duke Nukem Forever being released next month, I think we shouldn't lose faith in Perl 6 either.

    It's taken 10 years, yes, but sooner or later they'll realize that what people are waiting for is a _native_ perl 6, not one on top of parrot, haskell, perl 5 or any other external engine. Cause if you virtualize, you might as well use the underlying langauge - it has to be at least as powerful as perl 6.

  16. For me Perl is alive and well. by EEPS · · Score: 4, Informative

    Despite what many are saying, Perl is still used extensively even for new projects. I use it daily, and while I really like ruby and python, for a variety of reasons, I have not switch away from Perl for most projects. My only question is when will Strawberry Perl 5.14 be released?

    1. Re:For me Perl is alive and well. by aixylinux · · Score: 4, Interesting

      I agree completely. As a UNIX sysadmin I frequently write scripts. For short and simple things, shell is preferred. But if I anticipate any complexity, I reach for Perl. I've had the experience of getting deeply into a shell script and thinking "I should have used Perl". Perl has never let me down, although I confess at times the programs have that write-only, line-noise appearance. But that's just because I've learned to use the idioms, and I comment on the complex stuff for the benefit of those who follow me--which could include myself six months later.

      I'd write Ruby if I could. The syntax is cleaner, and objects are built-in, not bolted on. But Ruby is just not available where I need it. Does anybody know of an AIX LPP package for Ruby?

      Also, I've been deeply disappointed at the progress of Perl 6--but Perl 5 does everything I need, so I really don't miss it. Of all sad words of tongue or pen, the saddest are these--it might have been.

  17. but the power by Anonymous Coward · · Score: 3, Insightful

    With Perl, that complexity gives you power. If one does lots of programming, and their mind is in good shape, Perl can be used to rapidly dispatch programming problems.

    1. Re:but the power by kiddygrinder · · Score: 4, Insightful

      unless your problem is "what the hell does this code do that i wrote 6 months ago".

      --
      This is a joke. I am joking. Joke joke joke.
    2. Re:but the power by Nimey · · Score: 2

      You should document your code in a non-shitty way. Seriously, if you can't figure out what you did six months later, your doco sucks.

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
  18. Re:Perl - the COBOL of scripting languages by rubycodez · · Score: 2

    well, all the other languages jacked Perl's DBI (and many, many other things) for their libraries.

    Your company has history with Perl, but I don't think it will be chosen for new things now, PHP alone is mostly eating its lunch. Web serving the stats are something like 75% PHP5.x and 20% dot-NET but only 1% Perl with J2EE 5% (some overlap as sites run multiple langauges, but still....). Compare that to over ten years ago (when I was developing in Perl), it's really fallen.

  19. Re:Perl - the COBOL of scripting languages by jimmydigital · · Score: 5, Insightful

    All I'll say to that is that the entire computing world does not revolve around websites... or programming certification mills. =] Perl is the duct tape that holds the networked world together... and it's not dying any more than actual duct tape is. It's a refined tool used by professionals to do the jobs that have always needed done in a minimum of time and that don't cater to the latest buzz word laden development methodology.

    --
    Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats. -HLM
  20. Re:Perl - the COBOL of scripting languages by rubycodez · · Score: 2

    In default installs, Python is eating Perl's lunch on the command line, I can confirm by greping through my distro's /usr/bin and /usr/sbin. More python scripts to admin the system than Perl! That argument (in the default install) doesn't hold as much weight anymore, Python is also default in most major linux distros (and the new admin stuff is using that, while the crufty Perl admin scripts linger because no one cares to rewrite them).

  21. Re:Perl - the COBOL of scripting languages by iggymanz · · Score: 2

    that "minimum of time" is only until the next poor SOB has to modify some code. Then it's time to go a-wadin' through the whale guts.....

  22. Re:Perl - the COBOL of scripting languages by ducomputergeek · · Score: 3, Interesting

    Our entire API framework is Perl and has been for a few years now. Seemed like every time we needed to add a new format to return values in (originally was XML) like JSON, there always seems to be a perl module "for that".

    The best part of things is the fact that while we've added new functionality, we haven't had to do any maintenance work on the script in almost 5 years now.

    Biggest change we made from 5.8.x to 5.10 was rewrite some nasty els if statements and made them switch statements.

    The original web based management tool was originally written in PHP and that is what took all the time to maintain. It seemed like with each dot release of PHP some little thing broke and we were always fixing something every few weeks because of it.

    --
    "The problem with socialism is eventually you run out of other people's money" - Thatcher.
  23. A more readable changelog by shutdown+-p+now · · Score: 4, Informative

    A more readable changelog, with formatting, hyperlinks etc applied (rather than a raw pod file) can be seen here

  24. Re:headless camel by danbuter · · Score: 3, Informative

    I think the camel's head didn't fit. The pic probably needs resized. As for the camel, it's featured on "Programming Perl", which has been the main way to learn Perl for most programmers. BTW, "Programming Perl" is being updated for a maybe-December release. I was notified by O'Reilly after reviewing "Programming Perl" and saying it was old and out of date.

  25. Re:What about Perl 6? by bill_mcgonigle · · Score: 2, Interesting

    Perl 6 has 140+ different operators! That is absolutely insane. While I support being concise, Perl has far more complexity in the language core than any other language I have ever seen.

    I like this about English too. Can't tell that Larry is a linguist by training, can you?

    Come to think of it, I bet Python developers tend to be fond of Esperanto too. Some similarities there.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  26. It Lives! by Tumbleweed · · Score: 2

    Internet Yiddish LIVES!

  27. Re:What about Perl 6? by kiddygrinder · · Score: 2

    erm... i'm pretty sure there are a lot of gui programs that don't use print. ignoring that i think fixing brackets on print is pretty fucking trivial. do you have any better examples?

    --
    This is a joke. I am joking. Joke joke joke.
  28. Re:Perl - the COBOL of scripting languages by Greg+Lindahl · · Score: 3, Interesting

    The new search engine blekko is written in perl - wrote our own NoSQL database in it, too. We found CPAN to be an awesome resource; we use 600 distros from CPAN, and only found a couple of bugs in them.

    It's Java that's the new COBOL. (buh dum, ching!)

  29. Python 3 is death to Python by mangu · · Score: 4, Informative

    Python 3 is barely different from Python 2

    It's different enough to break the language for legacy code.

    When you have code by the million lines, it's impossible to have a script that can reliably convert programs like Guido thinks it can. It's not just adding parentheses to print, there are some beastly things, like giving the division operator a different behavior. In Python 2.7, the result of (3 / 2) is 1, in Python 3 it's 1.5. I have absolutely no way to pore through those million lines and checking every division to see which operator should I use, keep the '/' or change it to '//'.

    Besides, the changes from Python 2 to 3 are *all* in the direction of making it a more verbose language. I couldn't find any example of code that would be shorter in Python 3 than in 2. That goes against the philosophy of a scripting language, the last thing we need is a new Java.

    I had gradually changed from Perl to Python over the years, but this P3k made me reconsider if this was wise. Apparently, there's no good-for-everything language left. So, in the scripting side, where quick results count, I've been considering switching back to Perl. Conciseness is king here, and nothing beats Perl at that.

    As for large projects, thank god C is still there, still running K&R style code almost unchanged. Looking back over the years, I find that, for big projects, no language has given me less trouble than C. Once you get it running, it runs forever.

    1. Re:Python 3 is death to Python by Waffle+Iron · · Score: 2

      In Python 2.7, the result of (3 / 2) is 1, in Python 3 it's 1.5. I have absolutely no way to pore through those million lines and checking every division to see which operator should I use, keep the '/' or change it to '//'.

      When the // operator was introduced - over 10 years ago - they warned you that this change was coming. Ever since then, it has been prudent to use // wherever you want the answer of 3 divided by 2 to be 1. So if you had been coding according to best practices, you wouldn't have to look through all your code for divisions.

  30. Re:Perl - the COBOL of scripting languages by FreakyGreenLeaky · · Score: 2

    Exfuckingactly. Whilst the buzz-word slavering IT managers and their Java sycophant underlings hype around in Brownian motion fiddling feverishly with websites, the rest of the professional world maintains the foundation and glue that really makes all the shit "just work."

    With the possible exception of Python, nothing else comes close in satisfying it's intended purpose (talking toolkit/scripting/etc). Perl bashing reminds me of kids with snot-shiny upper lips whining about the "complexity" or "shortcomings" of C while not hearing the whooshing sound as the mothership-sized point sails over their heads.

    Same with COBOL. Just because you don't encounter it in your little Javascript/PHP career does not mean it's not out their pumping major iron. You'd be amazed how many COBOL professionals there are laughing at the ignorance of these arrogant little dickheads talking out their anuses.

    All programming/scripting languages have their place. They were all designed (some less so) to solve a specific problem.

  31. Re:Perl - the COBOL of scripting languages by Haeleth · · Score: 2

    superior (e.g. python)

    Python has some advantages over Perl -- cleaner syntax, a better REPL, none of the legacy shell-script-derived cruft that makes it so easy to write terrible code in Perl. It also has quite a few disadvantages that make it harder to write robust code, such as its lack of any equivalent to Perl's extremely useful "use strict" and its poorly designed scoping rules.

    I see a lot of new development taking place in both languages. I don't see much PHP, but that's a niche language restricted to web development, which isn't something I'm involved with.

  32. Re:What about Perl 6? by RDW · · Score: 5, Insightful

    "I was just going to say that back in about 2001 someone gave me advice not to learn Perl 5 because a Perl 6 release was imminent."

    It's a shame that this 'Osborne effect' has hung over Perl for the last decade. I wonder how Perl 5 would now be perceived if Perl 6 had been given a different name and announced as a research project into language development, rather than the next version of Perl? With better PR, Perl 5.10 could easily have been 'Perl 6'.

    All this tends to obscure the quet evolution of Perl 5 programming into what 'chromatic' and others are calling 'Modern Perl', using an idiomatic style that takes full advantage of recent language features (some borrowed from Perl 6) and CPAN to write efficient and maintainable code:

    http://www.modernperlbooks.com/
    http://onyxneon.com/books/modern_perl/

    As always, a lot of the most active development is happening outside the core language. Anyone interested in some of the directions Perl 5 is going in today ought to check out projects like these:

    http://www.iinteractive.com/moose/
    http://plackperl.org/
    http://www.catalystframework.org/
    http://mojolicio.us/

  33. Re:Perl - the COBOL of scripting languages by dskoll · · Score: 2

    PHP alone is mostly eating its lunch

    Interesting you say that... our product's Web interface is written in PHP and I rue the day I made that decision. For all of Perl's faults, PHP is about 100 times worse. No proper namespaces, completely wild-west wacky naming "conventions", no decent DBI-like library, crappy add-on modules (just try finding a decent YAML parser for PHP.)

    If I had to do something new, I'd probably look at Python. I have very little experience with it, but it seems quite easy to use and fairly readable. Nevertheless, CPAN still takes the crown for a useful repo of modules.

    There are still a lot of companies developing in Perl. They tend not to tout it or make much noise about it, though. It's not trendy any more.

  34. Re:Perl - the COBOL of scripting languages by Mozai · · Score: 3, Funny

    php5 is simpler?  What planet do you live on?

    In Perl:
    curl -sL 'http://slashdot.org/index.rss' |perl -ne 'm/<title>(.+?)</ && print "- $1\n";'

    Same thing in PHP5:
    curl -sL 'http://slashdot.org/index.rss' |php5 -r '$h = fopen("php://stdin","r"); while(! feof($h)){$line=fgets($h); if(preg_match("/<title>(.+?)</",$line,$match)){echo "- ".$match[1]."\n";}}'

    ... and if you say "well, php5 is simpler for what *I* need," I'mma gonna poke you for thinking that everyone else has the same needs as you.

  35. Re:Perl - the COBOL of scripting languages by bXTr · · Score: 2

    my $troll = $ubiquitous_BSD_is_dying_troll;
    $troll =~ s/BSD/Perl/g;
    print SLASHDOT $troll, "\n";

    --
    It's a very dark ride.
  36. Re:What about Perl 6? by chromatic · · Score: 2

    If Perl 6 had been presented from the start as an experimental 'sister language' (perhaps with a different name), rather than being named as Perl 5's successor over a decade early, perhaps the perception would now be different.

    People express that sentiment often, but I've never found it realistic. Many of the philosophical goals of Perl 6 are the same philosophical goals Larry had when designing Perl 5. Many of the tactical approaches are far different, but there's where my disagreement with the "It deserved the label as an experiment at the time!" idea arises. No one really knew how far redesigning Perl needed to go to achieve those philosophical goals until the RFCs and Apocalypses started pulling at loose strings in the sweater.

    Isn't your term 'Modern Perl' itself a way of saying that things have changed a bit since 1993, even though we're still using 'Perl 5'?

    Certainly, though it's less about using new and exciting features because they're new and exciting than it is about understanding how the language and its features, both new and old do—and, in some cases, don't—work. The biggest and most important language change has been the gradual lexicalizing of features such as filehandles, pragmas, grammar modifications, and even packages. You may have to squint to see the latter, but it's there. Perl 6 takes that principle to another level.

  37. Re:Perl vs Python, in OS scripts by rduke15 · · Score: 2

    A recently installed server in a small company (Debian Squeeze):

            $ find /bin /sbin /usr/bin /usr/sbin -type f -exec file "{}" \; | grep 'perl .*script' | wc -l
            196
            $ find /bin /sbin /usr/bin /usr/sbin -type f -exec file "{}" \; | grep 'python .*script' | wc -l
            46

    My notebook (Ubuntu 10.4):

            $ find /bin /sbin /usr/bin /usr/sbin -type f -exec file "{}" \; | grep 'perl .*script' | wc -l
            398
            $ find /bin /sbin /usr/bin /usr/sbin -type f -exec file "{}" \; | grep 'python .*script' | wc -l
            134

    Of course, some may prefer Perl to grep + wc (it's faster too):

            $ find /bin /sbin /usr/bin /usr/sbin -type f -exec file "{}" \; | perl -ne '/(perl|python) .*script/ && $$1++; END {print "$perl perl\n", "$python python\n"}'
            398 perl
            134 python