in reply to Using previous match in the same matching regexp
$substr = $string =~ /^(\d+) (.*)/ && substr($2, 0, $1); [download]
($len, $substr) = $string =~ /^(\d+) (.*)/ && ($1, substr($2, 0, $1)); [download]