http://www.perlmonks.org?node_id=899945


in reply to grep trouble

All this reminds me of why a colleague of mine stubbornly refuses to use any built-in variables, not even $_. But of course, as this example demonstrates, ignorance is not always bliss - even avoiding them doesn't stop them sneaking up and biting you on the arse. I think on the whole it is better to understand (read up on) the impact of code on the built-ins, especially $_ and the matching variables, and vice-versa. Merely being aware of their behaviour would prompt using debug and setting a watch on these variables before testing the relevant areas of code, when encountering such "anomalies".

One world, one people