in reply to Using previous match in the same matching regexp

my ($len,$substring) = ($string =~ /^(\d+) ((??{qr".{$1}"}))/);
perlre explains the experimental postponed-regexp feature.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Using previous match in the same matching regexp
by Anonymous Monk on Nov 16, 2005 at 23:17 UTC
    Tightening up just a wee bit more...
    my ($len,$substring) = ($string =~ /^(\d+) ((??{".{$1}"}))/);