There's a better solution here. Always use warnings, especially use warnings 'void';, which will give you a "useless use of a constant" warning, since your "\n" isn't doing anything...
(OK, looking at the output, this is one of the few cases where you get a useful "'print (' interpreted as function" without getting some other error... but the advice still holds. Use warings, or -w, even on quick one-liner check code, esp when something strange is happening.)
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).