doubt in Definition of sub routine.

From: Anand V (Anand.V_at_gxs.com)
Date: 08/05/04


To: beginners@perl.org
Date: Thu, 5 Aug 2004 06:07:33 -0400 

Hi All,

I am using code written by some one else. I didn't understand the difference
between these subroutines, the way they were defined.

1. sub addToLog { Some code } Any specific reason where we should
not use braces ??
2. sub displayEnv( ) { " } Any specific reason why we should
use braces ??
3. sub trim($) { " } Any specific reason why we should
use a brace with a $ sign in it ??

Could some one specify reason when to use braces and when not to use .
Replies are highly appreciated and thanks in advance for your help.

Regards
Anand



Relevant Pages