in reply to Syntax error near Print

That means Perl is seeing print, but it's expecting something else. The error is actually earlier. Check what's missing(?) before the print.