I have a condition:
next if ( ! ($x or $y or $z) );
The logic of the check is that at least one must be numerically non-zero to continue in the loop.
I trust that they actually are numbers.
The problem is that perl stores floats as strings internally. So a check on ! $x where $x='0.00' does not actually evaluate to true: my $x = 0.00; if ( ! $x ) { never_gets_here(); }
What is the easiest way to force numeric evaluation of a variable without making the line too verbose?
I’m not sure where you get the idea that Perl stores floats as strings. Floats and strings are different things:
If you want to force numeric context on an unknown scalar, you can just add zero to it, e.g.