#!/usr/bin/perl -slw use strict; $|=1; BEGIN { eval "use Device::SerialPort qw( :PARAM ); 1;"; die "$@\n" if ($@); } my $port = $ARGV; foreach $port(@ARGV) { my $ob = Device::SerialPort->new($port, 1) or die "Could not open $port: $!"; sleep 1; print "$port is open"; undef $ob; }