[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Subroutines



Matthias Ulrich Neeracher <neeri@iis.ee.ethz.ch> writes:


>Subroutines may be declared with either:

>use subs qw(MainMenu);

>or

>sub MainMenu;

>All of this is strictly Perl5. In Perl4, & is mandatory so there is never an
>order problem.
>Matthias

Another other option, is to put parenthesis after the subroutine name
where the sub is called:

MainMenu();

This will force the compiler to recognize it as a subroutine call.
(The times where this is not useful is when you want to give the
subroutine to get the same arguments as the calling sub. Giving an
empty argument list clears out @_.)