in reply to Re^3: Recursive regular expression weirdness
in thread Recursive regular expression weirdness

Thank you again for elaborating on your earlier reply. I can see from your examples how localisation is necessary to avoid, for example, @memoList getting too many 'b's. There is one thing that is confusing me though. In the second and third patterns I don't understand the significance of the extra (memory group?) brackets around the code block (?{...}), as in ((?{ @memoList = @{$^R} })) and ((?{ @memoList = @temp })). Why do we need these when we are assigning within the pattern rather than having to remember outside of it? I must be missing something.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^5: Recursive regular expression weirdness
by ikegami (Patriarch) on Mar 30, 2006 at 19:05 UTC
    Copy and paste bug. Those parens are indeed unnecessary here.
      Ah! A bit of a double-edged sword is copy & paste. I hope they don't use it in nuclear power stations and things :-)