in reply to Re^2: Problem with regex
in thread Problem with regex

I would actually suggest forgoing the loop altogether and using grep

Nothing wrong with using grep to fill the @FILES array, although I might do grep { -f and not -l } depending on how symlinks should be treated. However, unless my eyes are failing me, you still have the loop in your code.

And do you really want to use "die" in a loop?

The OP seems to and, since I don't know what the requirements are, I followed his/her lead.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^4: Problem with regex
by mpeever (Friar) on Sep 16, 2008 at 17:11 UTC

    Your eyes are not failing you! I clearly should have said I would use fewer loops... my bad!

    We could wrap the loop in a "map" but I don't think it would add to the clarity of the code, so it's probably not worth doing. But I generally find list operators easier to read than nested loops.