Ooops, now I'm getting this error:
This is my code:Name "Device::SerialPort::carp" used only once: possible typo at dial. +pl line 58.
eval "use Device::SerialPort; 1" or die $@; my $directory = '/dev'; opendir (DIR, $directory) or die $!; while (my $file = readdir(DIR)) { #print "$file\n"; push (@ports, "$directory/$file") if ($file =~ /ttyS/g); push (@ports, "$directory/$file") if ($file =~ /ttyUSB/g); } closedir(DIR); foreach my $port (@ports){ no warnings 'redefine'; local *Device::SerialPort::carp = sub {}; $PortObj = new Device::SerialPort($port, 1) or next; $PortObj->close; push(@ok_ports, $port); sleep (1); };
In reply to Re^3: Supressing error messages on serial port open in Linux
by pashanoid
in thread Supressing error messages on serial port open in Linux
by pashanoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |