in reply to Unable to split this line of code (printf warning)

I tried this out myself, and it's a new one to me, silly Perl!

Your statement works fine if you ensure there's no space between the function name and the opening parenthesis. i.e: "printf(" works but "printf (" fails.

I'd say this is a shortcoming in the perl interpreter. You were using valid syntax all along.. it's just that it seems perl doesn't like the whitespace in this situation..

Replies are listed 'Best First'.
Re^2: Unable to split this line of code (printf warning)
by chromatic (Archbishop) on Nov 25, 2005 at 01:45 UTC

    It's not a shortcoming of the interpreter; it's the ambiguousness of using the same symbols for two different purposes. It can't read your mind to know whether you want to group an expression with parentheses for precedence purposes or use the parentheses to group the arguments to the operator.

    I suggest not using a space between a function name and the opening parenthesis.