yields Search pattern not terminated or ternary operator parsed as search pattern. The error goes away if I call the function as func(). My question: Why does a question mark after a bareword parse as search pattern? Is it just to comply with those internal functions such as grep or split, which accept a regexp as first argument, or is there a deeper reason for this seemingly oddity?use strict; use warnings; sub func {} func ? '-N ' : '';
In reply to Why do I need parentheses here? by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |