I don't think you will be able to do this in one step, you will probably have to do something like this:
if ( /^(\d+?)/ ) { my $len = $1; if ( /^$len(.{$len})/ ) { my $value = $1; # do something with $len and $value } }
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Backref in a regex quantifier
by jasonk
in thread Backref in a regex quantifier
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |