Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: strange File::Find thing?by chip (Curate) |
on Mar 22, 2004 at 20:40 UTC ( [id://338758]=note: print w/replies, xml ) | Need Help?? |
You forgot to backwhack the dots in your patterns, and to anchor them at the end with a '$'. You're getting everything that contains 'h' or a 'c' (except as the first character).
Incidentally, you'll need to double the backwhack and backwhack the '$' unless you use // for the pattern (which is recommended). So you should spell it: if (/\.c$/ || /\.h$/) { push ... } BTW, "$File::Find::dir/$_" is already available as $File::Find::name. -- Chip Salzenberg, Free-Floating Agent of Chaos
In Section
Seekers of Perl Wisdom
|
|