Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: strange File::Find thing?

by chip (Curate)
on Mar 22, 2004 at 20:40 UTC ( #338758=note: print w/replies, xml ) Need Help??

in reply to strange File::Find thing?

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

Replies are listed 'Best First'.
Re: Re: strange File::Find thing?
by McMahon (Chaplain) on Mar 22, 2004 at 20:44 UTC
    Thanks! I knew that regex looked odd, but I got fixated on the module. Have rearranged both attitude and code properly. -Chris

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://338758]
[hippo]: Download from https://metacpan. org/pod/CPAN and follow the instructions.
[Spenser]: I'm unable to install modules using cpan. it's not installed
[choroba]: What OS or distribution?
[hippo]: But as shmem says, CPAN has been in core since 5.004 so unless you are on a packaged system you probably have it installed already.
[Spenser]: It's a stripped down version on a NAS device.
[Spenser]: It's frustrating
[Spenser]: Perl 5.10.0
[Spenser]: It uses opkg to install software
[choroba]: 5.10.1 would be much better

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-03-17 12:38 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (224 votes). Check out past polls.