in reply to Re^3: Braino - why is this not working?
in thread Braino - why is this not working?
Detail: the foreach works sets "$_" to each value in the list, in turn
but ...print "_=$_\n" for (1..3);
Your post hit the reason for the problem. "Grep" sets $_ to each member in turn, so searching for '$_' will always return 'true' if you search on /$_/;
Absolutely simple, got caught with my 1 'register' var being double used. Sigh. Thinking about the simplicity of using $_ in 'foreach', I forgot about grep...sigh.
MUCH thanks -- very it was driving me crazy!
|
|---|