When using arithmetic expressions in combination with an undefined or empty string, perl throws an error. Is there a clean way to use zero in case a string is empty?
This does not work:
$x = 1 + $emptyVar
In bash you could use something like this for instance to use zero if the variable $emptyVar is empty:
x=1+${emptyVar:-0}
I am looking for something similar as this