in reply to My Perl filename dictionary project

I used this code

#! perl -slw use strict; use File::Find; my %extns; find( sub{ $extns{ lc($1) }++ if -f _ and m[\.([^\.]+?)$]; }, @ARGV ); print "$_ => $extns{ $_ }" for sort keys %extns;

to produce this list. I omitted the src directories, but include my packages directory where I build modules not available via PPM.

C:\Perl>p:371407 bin lib site packages 0 => 1 09d => 1 1 => 1 25 => 1 33 => 1 44 => 1 5 => 1 adjust => 1 al => 483 bak => 15 bat => 57 bpf => 5 bpg => 1 bpr => 5 bs => 136 c => 55 cfg => 7 cgi => 16 css => 1 cur => 1 cxx => 1 def => 6 dll => 139 e2x => 6 eg => 2 emf => 1 enc => 17 exe => 6 exists => 18 exp => 133 foo => 13 gif => 7 guess => 1 gz => 7 h => 218 html => 4 icon => 3 in => 4 inc => 1 inl => 22 iss => 1 ix => 30 ld => 3 lib => 138 libnet => 2 m => 20 m4 => 3 mak => 6 make => 1 makefile_pl => 1 mask => 3 mirror => 1 mms => 1 msg => 1 npuz => 1 obj => 17 old => 1 packlist => 65 pbi => 1 pc => 2 pdb => 19 perl => 2 pkg => 58 pl => 544 pm => 925 pm~ => 2 png => 2 pod => 292 ppd => 62 ppm => 1 ps => 1 pub => 1 self => 1 sgml => 1 sh => 2 skip => 1 sub => 1 t => 51 tar => 2 terms => 2 txt => 33 types => 1 uu => 2 vms => 1 wmf => 1 xbm => 12 xpm => 14 xs => 6 xst => 1 yml => 4 zip => 1

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: My Perl filename dictionary project
by brian_d_foy (Abbot) on Jul 02, 2004 at 22:45 UTC
    Thanks for the code. :)

    The trick here is to know what those things mean, and although I'm not a Windows person, I'm guessing that most of those extensions are not interesting in this case. Extensions like zip, xpm, xbm, wmf, tar, sh, and many more off of my screen at the moment probably have their usual, non-perl significance.

    I would certainly appreciate any Windows user who could pick out the file names and extensions particular to that OS, though.

    --
    brian d foy <bdfoy@cpan.org>