On the future of Perl 5
Posted Dec 4, 2008 15:19 UTC (Thu) by
hummassa (subscriber, #307)
In reply to:
On the future of Perl 5 by job
Parent article:
On the future of Perl 5
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
(
Log in to post comments)