Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 musing on the Monastery: (18)
As of 2015-07-06 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls