[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Mac Penguins from Mars, Unix Penguins from Venus?




If you're not interested in Penguins, please hit n now.  I apologise
for the wide distribution, but I'm kinda stumped here.  


  I've been spending some time getting Penguin to work on Macintosh.
I'm happy to say, all of IO, PGP, and the core Penguin stuff
is working fine, when I go Mac <-> Mac.

  The problem, as you might guess, is waddling from unix <-> mac.
The line termination characters cause IO to hang for lack of
an autoflush().

  The way I see it, there are several ways to handle this, but I
really don't like any of them real well.

1. Hack the poor penguin half to death, to make him/her produce
frames and putframe()/getframe() in an more generic way.  This will
probably mean substituting the IO::Socket::print and IO::Socket::getline()
stuff in Penguin::TCP with a less fun (possibly buffering) read() 
and write().  

2. Produce some sort of additional module for IO called Translate.
This will imply adding the additional call into Penguin, to operate
on the frame, and I'm still not sure how to get autoflush to work,
but we could grab the CAP code, and nail ISO8859 and NCS translations at
the same time, possibly.  CAP does this pretty nice.  

3. Hack IO::Socket to do the right thing specifically for Mac.
Overriding the IO::Handle::print (and others which use stdio) 
method in IO::Socket.  Possibly deriving a new subclass, like
IO::Socket::Mac, I dunno.

  Am I missing something blatantly obvious?  I personally like
number one above.  And I'd argue that, since we not sending
around bytecode, the more generic the better.  I'd also be
willing to rewrite the methods as necessary, but I'd like
to get buyin from Felix, and hopefully input from the mac/unix
wizards out there, if there's a better way.



Thanks,

Bill