In this case, for arcane reasons, $param3 = @_ ? "Shift" : shift works as-is but is execution-order unsafe and if the expression were included in some other larger expression, could be quite a problem.
$param3 = @_ ? "Shift" : $_[0]; shift;
The preceding example would be the safe way to write it.
In reply to Re^2: Confused by Perl ternary operator
by diotalevi
in thread Confused by Perl ternary operator
by newest_newbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |