in reply to unless weirdness
I believe you are mistaken. I tried with 5.6.0, 5.6.1, 5.8.0, 5.8.8, 5.8.9 and 5.10.0, but I don't get what you get.
>perl -we"use strict; 1 if func" Bareword "func" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. >perl -we"use strict; 1 unless func" Bareword "func" not allowed while "strict subs" in use at -e line 1. Bareword "func" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors.
In both case, the fix is to predeclare the sub (sub func;) or use parens in the call (func()). You can't omit parens on a sub call to sub that hasn't been declared.
|
|---|