in reply to Counting the Extensions of the Directory

I'm not sure what an extension is, because it's apparently some file with a period followed by non-alphanums at the end of the name. That's pretty rare. Did you mean \w+ instead of \W+?

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re: Counting the Extensions of the Directory

Replies are listed 'Best First'.
Re^2: Counting the Extensions of the Directory
by Mago (Parson) on Dec 14, 2005 at 12:54 UTC
    Ok ! Yes, you are certain, with \w+ is very better.

    perl -e 'while(<*>){if(-f && /\.(\w+)$/){$e{$1}++}}print "$_ -> $e{$_} +\n" for keys %e'
    Thanks;


    Mago
    mago@rio.pm.org