Unfortunately it seems that the OS in question (ubuntu) lacks packages for IO::Termios.
Yes, IO::Termios needs to be installed from CPAN, using e.g. cpanm, although installing modules into the system Perl has the caveats that uninstallation is tricky and it may clash with modules installed using the system's package manager. You could consider local::lib or even perlbrew, and it's also possible to install modules to some other global directory where they won't clash with modules installed by the system package manager (depending on the distro, that could be something like perhaps /usr/local/lib/site_perl, check your perl -V output for the preconfigured @INC).
But it definitely didn't die while setting 19200, which it now does.
Yes, that is indeed strange. Can you say what the old and new versions of IO::Stty and Perl were?
Lastly, I looked at your link about system -- maybe I'm missing something, but system(LIST) seems to be just fine?
Well, on a *NIX system the system(LIST) form should be "safe". Using a module gives you the advantage of built-in error handling (e.g. IPC::System::Simple, which has a drop-in replacement for system), or the ability to capture STDOUT/ERR in case you want to hide it from the user or inspect it for error messages (e.g. IPC::Run3). If you don't care about those things, then yes, system(LIST) where LIST has two or more elements is fine.
(BTW, an open mode of +> will clobber the file first - for a serial port it's probably fine, but for regular files you would probably want +< for read-write access instead.)
In reply to Re^3: How to set tty settings from perl
by haukex
in thread How to set tty settings from perl
by Sec
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |