in reply to Warning while using ternary operator
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';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Warning while using ternary operator
by simonz (Sexton) on Dec 16, 2013 at 11:10 UTC | |
by BrowserUk (Patriarch) on Dec 16, 2013 at 11:14 UTC | |
by Athanasius (Archbishop) on Dec 16, 2013 at 12:49 UTC | |
by Bloodnok (Vicar) on Dec 16, 2013 at 14:45 UTC |