in reply to •Re: Re^2: Function Prototypes and Array vs. List (Pt. 2)
in thread Function Prototypes and Array vs. List (Pt. 2)
I only use prototypes if there are clear benefits (\@ and & prototypes, sometimes a prototype with a single $ (which changes the way perl compiles your Perl)). But often it's too much of a nuisance.
I also don't agree with your reasoning that with such a simple description of create you should use $array[0] Take a look at the description of POSIX::strftime. With your reasoning, the proper way of calling it would be:
instead ofuse POSIX; my @chunks = localtime; print strftime "some format", $chunks [0], $chunks [1], $chunks [2 +], $chunks [3], $chunks [4], $chunks [5 +], $chunks [6], $chunks [7], $chunks [8 +];
print strftime "some format", localtime;
strftime could have been prototyped as $$$$$$$;$$$; the description doesn't say it's not, and spells out the arguments for strftime.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^N+1: Function Prototypes and Array vs. List (Pt. 2)
by tadman (Prior) on Jun 14, 2002 at 04:46 UTC | |
by danger (Priest) on Jun 14, 2002 at 07:43 UTC |