|Perl Monk, Perl Meditation|
Re^2: when $$s =~ m/\G.../gc is too verboseby stefp (Vicar)
|on Feb 07, 2006 at 22:31 UTC||Need Help??|
About the copy: before even thinking about positions in strings, using a string copy is a no-no. Copying the string to be parsed for each token is madness.
About a table for lexing : this is irrelevant to the discussion. Also, lexing can be more complex than matching. Yes, one can insert regular code in regex but that the sign that a table based lexing is not appropriate.
As I said tye, using for is the right way to alias to $_. I don't like it because in the programming space, for is a loop... for me. :)
In the natural language space, well, English is not my first language.So to paraphrase Churchill, for is the worst solution, but it is the only one.
Hopefully, like said TimToady, Perl6 will be cleaner.