in reply to Illegal subroutine

Have you tried taking out terms? Try eliminating terms as long as the error persists.

Have you looked at taking out the complete subroutine? Are you sure that the error is with your subroutine?

Have you looked at perlsyn to check that your subroutine declaration is correct?