|Don't ask to ask, just ask|
Re: Perl Bug in Regex Code Block?by demerphq (Chancellor)
|on Sep 03, 2001 at 17:38 UTC||Need Help??|
Ok, well I am running 5.6.0 AS 623 and I get different output for your code:
Which says to me that perl is using the dynamic variable inside the regex eval. (Incidentally the docs do say that this is an experimental feature and may not work appropriately. Also they mention localization so I suspect this is maybe intended.) Also if you change the my to a local it produces the desired results.
Just ran it on AS 628 and it produces the results you said it did. Although worked as expected under our and local. My money says this is a bug.
But this all gets weirder.
When I change the code under (only did this under 623) (barely) to
I get the same result again. Now uncomment the last print line and run it again. I get a
Which to me doesnt make any sense at all. It should die in both cases cause the dynamic @counts is not declared, or in neither, but not like this.
And I have another point of weirdness to note in the regex you are using you have placed a '^' caret at the END of the regex, which for some reason makes your print statement fire twice. If I remove the ^ it prints once. Either way I dont see what is going on here at all....