Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Counting the Extensions of the Directory

by merlyn (Sage)
on Dec 13, 2005 at 21:39 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found