Re: problams with IO::Socket::INET

garrow@whirlwind.fmr.com
Tue, 27 Jan 1998 17:49:25 -0500


Tom writes:
   >> $sock = new IO::Socket::INET (PeerHost => "localhost",

   >That should be PeerAddr not PeerHost

   Why doesn't it give an error message on wrong arguments!?

While I disagree with Tom on some of this thread, and I agree with
the newbies that "Objects R |<ool", I have to say that I too dislike
the lackadaisical programming going into many modules that are then
being put into the core, or otherwise promoted as being "all that."

With the exception of my own code, I have never seen any that actually
checks that the arguments passed in this style are the arguments
expected.

Oddly, I might have expected Tom to be one of the people demanding the
freedom to use the same hash for a dozen different functions, with
different keys being used in different calls.


Of course, if people had taken my requests for legalization of 
 ($named, $variable; $prototypes)
seriously, then perhaps you could be taking advantage of my code that
checks named-argument lists data against the types and names specified
in that prototype, with implicit defaults:
 (;$Listen=5,$LocalAddr='localhost,$Proto='tcp', .....)

such that calls to functions with those prototypes automatically grok
the named-arg passing style & do the right thing to provide missing
arguments with their default values.

But, you all decided that it'd be more fun to not get anything done
than to let me contribute some code now. Go fig. Now I have the
pleasure of working, reliable, strongly checked argument passing, but
I have to live with the fact that at any moment one of the "Perl Gods"
might decide to break all my code because _he_ has a good idea.

Oh well, good thing I'm planning for that too.

--
John Redford
GArrow