When you realize that a subroutine you've written for one script can be used with little or no modification in another script, you're ready to write your first module.