This does not make $tmp2 defined if $2 is undefined. Don't you mean something like:
Or, if you have the defined-or patch installed, something like:my $tmp2 = length $2 ? $2 : '';
my $tmp2 = $2 // '';
Liz
In reply to Re: Re: Use of uninitialized value in pattern match (m//)
by liz
in thread Use of uninitialized value in pattern match (m//)
by wolis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |