181

Subroutine Prototypes
Required VS Optional Arguments

  • You may specify manditory arguments as well as optional arguments in a prototype definition

  • Separate parameter definition tags with a ; symbol to define first mandatory and then optional arguments

      sub MyIndex($$;$) { EXPR }

      MyIndex( $myString, $subStr );
      MyIndex( $myString, $subStr, $offset );