Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 studying the Monastery: (6)
As of 2014-12-25 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls