title: How to suppress Perl warnings emitted from within a loaded module's code?
body: <p>My Perl program is reading data from a serial device attached through USB. Headlines of my script in pseudo-Perl:</p>
  
  <pre><code>use warnings;
  use strict;
  
  use Device::SerialPort;
  my $PortObj = tie( *$handle , "Device::SerialPort" , $PortName ) or die "Cannot open serial port: $!\n";
  while ( 1 ) {
    my $readLength = read( $handle , my $frameData , $frameLength )
  }
  </code></pre>
  
  <p>All works fine and even when I unplug the device from USB I'm able to recover from that situation, when the device file disappears and reappears. I can catch all errors spawned from my own script, but the loaded modules (Device::SerialPort) spawns warnings too and I don't want them to appear in my logging.</p>
  
  <p>Can I add some sort of flag to my code so I don't see these specific warnings? It is important for me that only warnings from the module(s) are suppressed, not the warnings from my own script. Currently it looks like this:</p>
  
  <pre>
  [/dev/ttyUSB1]   0x0020 : 00 00 00 00 00 00 00 00 00 AA 93 82 73 68 5E 58 : ............sh^X
  [/dev/ttyUSB1]   0x0030 : 55 54 52 52 4F 4E 50 51 50 00 00 00 00 00 00 00 : UTRRONPQP.......
  <b>Use of uninitialized value $count_in in addition (+) at /usr/lib/perl5/Device/SerialPort.pm line 2214.
  Use of uninitialized value $string_in in concatenation (.) or string at /usr/lib/perl5/Device/SerialPort.pm line 2232.</b>
  [/dev/ttyUSB1] Restart required!
  [/dev/ttyUSB1] Cannot open serial port: No such file or directory
  [/dev/ttyUSB1] Cannot open serial port: No such file or directory
  [/dev/ttyUSB1] Cannot open serial port: No such file or directory
  
  [/dev/ttyUSB1]   0x0000 : 41 42 01 40 71 01 1C E4 80 99 80 80 80 80 00 00 : AB.@q...........
  [/dev/ttyUSB1]   0x0010 : 00 03 00 00 83 00 01 01 00 00 00 00 00 00 00 00 : ................
  </pre>
  
  <p>So it is about the two <code>Use of uninitialized value</code> warnings that I want to get rid of. The other warnings are my own logging.</p>
  
  <ul>
  <li>libdevice-serialport-perl 1.04-2build1</li>
  <li>perl v5.12.4</li>
  </ul>