Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: strange File::Find thing?

by etcshadow (Priest)
on Mar 22, 2004 at 20:38 UTC ( #338757=note: print w/ replies, xml ) Need Help??


in reply to strange File::Find thing?

It's because

  • File::Find gives you back directories, as well as files, and you don't perform a -f $_ test to see if it is a file or not
  • you do a regexp like: $_ =~ ".c" which isn't doing what you think it is... for example "ac" will match that regular expression... you probably want: $_ =~ "\\.c", or perhaps even just /\.c/ which will do the same, but be more imediately recognizable.
Enjoy.

Update: fixed missing (second) backslash in the quotes.

------------ :Wq Not an editor command: Wq


Comment on Re: strange File::Find thing?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-07-26 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (178 votes), past polls