--- Aaron Craig <[EMAIL PROTECTED]> wrote:
> At 15:12 22.05.2001 -0700, you wrote:
> > > > The problem is: PROTOTYPES MUST BE SEEN BEFORE THE FUNCTION IS
> > > > CALLED. So few people realize that (for one reason or
> > > > another[1]).
>
> > For that reason, I usually do my function definitions at the top of
> > my programs. That way they've already been thoroughly parsed before
> > ever being called. I used to do that in my C code, too.
>
> I did that too, but I got annoyed at having to remember to change the
> prototype at the top of the script whenever I changed my sub down
> below.
No, no....what I meant was that I wrote the actual *functions* at the
top of the program, so that a seperate prototyping wasn't necessary.
Like so:
#!perl -w
# define functions first
sub func($) { print shift }
# then write the program main body
func($_) while <STDIN>;
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/