You'd think you'd get 100, instead you get undef.$b = 'test 100'; %hash = ( a => ($b =~ /(\d+)/ ? $1 : 0), b => ($b =~ /\d/ ? 1 : 0), ); print "$hash{a}\n";
In reply to Strange Regex Behavior by Manchego
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |