laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This just came up in the CB. Someone wanted to filter an array into two arrays. I decided to be clever and suggested this:
That works as expected, but it turned out that the filtering should be done on a regex match. I changed my code to:
But that gives a "Bizarre copy of ARRAY in leave" error. Changing it again to:
gets it working again. And on reflection, that's what should work. So, I guess the original version shouldn't work (you should need to take references in that case as well). But it does. Any explaination? --<http://www.dave.org.uk> "The first rule of Perl club is you do not talk about
Perl club." In reply to Potential Ternary Operator Bug by davorg
|
|