According to the revised Synopsis 6, named subroutines can have one of three
forms:

 

   my RETTYPE sub NAME ( PARAMS ) TRAITS {...}    # lexical only

   our RETTYPE sub NAME ( PARAMS ) TRAITS {...}    # also package-scoped

                        sub NAME ( PARAMS ) TRAITS {...}    # same as "our"

 

 

Note that the third possibility here does not include a return type.  Does
this imply that if we want to declare a subroutine with a return type we
have to declare it as either a "my" sub or an "our" sub?

 

Joe Gottman


Reply via email to