Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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

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

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 contemplating the Monastery: (7)
As of 2015-10-07 18:51 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (197 votes), past polls