in reply to Re: Bug with nested named capture buffers
in thread Bug with nested named capture buffers

Thanks for the help! The bug report contained a hint that led to a trivial workaround. Namely, that %- functions correctly, while %+ has problems. From %- you can implement %+ with something like this:
my %plus = ();
while (my ($k, $v) = each %-) {
    $plus{$k} = $v->[0] if scalar(@$v)>=1;
}
  • Comment on Re^2: Bug with nested named capture buffers

Replies are listed 'Best First'.
Re^3: Bug with nested named capture buffers
by ikegami (Patriarch) on Aug 31, 2008 at 19:19 UTC

    Great! Two quick tips:

    if scalar(@$v)>=1;
    can be written as
    if @$v;

    If you could please avoid <pre>...</pre> on PerlMonks. <c>...</c> is preferred. It also saves you from encoding "&", "<" and ">"