doubt in Definition of sub routine.

2004-08-05 Thread Anand . V
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

Re: doubt in Definition of sub routine.

2004-08-05 Thread Gunnar Hjalmarsson
Anand V wrote: 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

Re: doubt in Definition of sub routine.

2004-08-05 Thread Jose Alves de Castro
On Thu, 2004-08-05 at 11:07, [EMAIL PROTECTED] wrote: > Hi All, Hi > 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

Re: doubt in Definition of sub routine.

2004-08-06 Thread Jeff 'japhy' Pinyan
On Aug 5, Jose Alves de Castro said: >sub trim($), for instance, means that trim will work on a scalar. It means that trim() expects ONE argument and will enforce scalar context on it. trim($foo) and trim(@bar) both work. >This is useful to, instead of something such as > >trim($var) > >use som