Re:Perl code that is syntactically correct only on Fridays
by nousermane on Wednesday February 16, 2022 @11:47AM
(#30362273)
> you could cause mayhem with __DATE__
It takes some patience, but people do try: https://stackoverflow.com/questions/11697820#16472369
There's no day-of-week but you could cause mayhem with __DATE__
>(2) if the compiler will notice errors in the unexecuted branch of an #if
Compiler only gets to see preprocessor output, it won't.
>if printf; would give a syntax error
Perhaps surprisingly but no, it's just statement without effect (containing expression returning function pointer to printf).