When $i ne 'one', the constant: 'nothing' is not assigned to anything, thus in a void context.
Did you want:
$hash->{'name'} = ($i eq 'one') ? "hello"."world" : 'nothing';
In reply to Re: Warning while using ternary operator
by BrowserUk
in thread Warning while using ternary operator
by simonz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |