> One of the problems with prototypes is that they are not prototypes, at
> least not in the sense that other programming languages use them.
I am aware of this "problem", which, personally, I don't consider a problem,
because it is documented fairly clearly.
> Instead, they allow us, amongt other things, to force function arguments
> into a particular context. In your example, the first argument *doesn't*
> have to have a scalar value.
I wasn't using the prototype to check the parameters, I was using it to ease
the use of the function. Without the prototype the function would have to
be called thusly:
append_and_print(\$stuff_to_print, "hi", " there\n");
The prototype serves simply to enreference $stuff_to_print, so it doesn't
have to be enreferenced by the programmer using it. It was meant for
nothing more. With both solutions there is the possibility of passing a
reference to another type of data. The only solution, if this is considered
a serious enough problem, is to check the parameters more thoroughly. The
code snippet I gave was but an example of one solution, it was not meant to
be used without examination by the person using it.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]