...but this gives me $1 = aa, $2 = bb, $3 = cc...$_ = "aaaabbbbcccc"; if ( not /^(\w\w)(\w\w)(\w\w)$/ ) { if ( not /^(\w\w)\w\w(\w\w)\w\w(\w\w)\w\w$/ ) { die "failed"; } } print "$_ = $1 $2 $3\n";
...as I would have expected from the first snippet. Am I just being thick?$_ = "aaaabbbbcccc"; if ( not /^(\w\w)\w\w(\w\w)\w\w(\w\w)\w\w$/ ) { die "failed"; } print "$_ = $1 $2 $3\n";
In reply to capture vars undef by msemtd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |