in reply to How to call a function

Calling a function with empty parens, dostuff(), passes an empty parameter list. The @_ array in the called function will be empty. Of course, by putting parameters in the parens, you will pass them.

Calling a function with the ampersand, &dostuff, will pass the current contents of @_ to the called sub. This can be very useful for exception handling, OO programming, or perhaps if you rename a function but want to keep the old function around because others are still using your code.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.