On Mon, May 23, 2011 at 08:05:18PM +0100, Paul LeoNerd Evans wrote: > I've been getting annoyed lately at the awkward and insane steps > required to go through just to get a serial device
On Wed, May 25, 2011 at 11:21:50PM +0200, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 wrote: > > I've missed something totally nonobvious on > > CPAN > Device::SerialPort? Device::SerialPort is exactly what I was talking about when I mentioned "awkward and insane steps" :) Contrast IO::Socket; you make a $sock object, then call methods _on the very IO handle_ to configure it (bind, connect, sockopt, etc...). This is the way of using IO::Termios too; that the very IO handle gains new methods that inspect or control its nature as a serial or TTY device. > If you know it, then write a piece of contrasting > documentation so that a potential user can make an informed decision to > employ > your module over D::S or vice-versa. > > If that's too abstract, put yourself in my shoes when writing this program: > <https://github.com/Metalab/hsc2011/blob/a799dc1ea19261e4d64290222541a5d46de4fb06/software/serial- > filter> Why would I use one module or the other? To be honest, in your use-case I'd suggest socat, instead of writing some Perl code :) (Also not wanting to be too much a code review critic, but your code has a serious bug in that it is using some select-alike polling mechanism on STDIN, but then using <STDIN> to read a line. I suggsest not doing that ;) ) -- Paul "LeoNerd" Evans leon...@leonerd.org.uk ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
signature.asc
Description: Digital signature