Just to make sure you didn't miss the point. If you use $f= !1 then 0+$f does not cause a warning. So, if you want $f to stay the empty string, you can also use: $f ||= !1; if you don't have control over how $f is initially set. Then 0+ and sprintf "%d", etc. will all work without giving a warning.
- tyeIn reply to (tye)Re2: forcing numeric context
by tye
in thread forcing numeric context
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |