Add parens to your expression to get the operations to occur in the right manner:($base_string =~ /^#/ ? ($foo = $') : $bar) = $base_string;
$base_string =~ /^#/ ? ($foo = $') : ($bar = $base_string);
In reply to Re: Why won't $' work in a trinary operation?
by japhy
in thread Why won't $' work in a trinary operation?
by satchboost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |