in reply to subroutine syntax

Above suggestions will help get you off the ground, but you've got perl's own documentation available, too. Use
perldoc perlsub
at your command line or plunk "perlsub" in the search box at the upper left of this page.

Use the docs, Luke!