> my $junk;
> print 1+$junk;
> Returns an unitialized value warning, as expected.
> print 1+($junk ? $junk : 0);
> Returns 1, no warning.
This should not return a warning. This statement says, if $junk is true then return $junk add 1 to it and print the result. If $junk is false, which is the case since it is undefined, then return 0 and add 1 to it and print the result.
I think what you meant is if you wrote it like:
print 1+ ( $junk ? 0 : $junk);
Then it will return a warning if $junk is undefined.
zzspectrez