Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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.

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

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2016-10-22 05:46 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.