Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Counting the Extensions of the Directory

by merlyn (Sage)
on Dec 13, 2005 at 21:39 UTC ( #516440=note: print w/replies, xml ) Need Help??


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


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://516440]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2021-10-24 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (88 votes). Check out past polls.

    Notices?