title: Am I using utf8::is_utf8 correctly?
body: <p>Does this work correctly? Some error messages are already decode and some need do be decoded do get a correct output.</p>
  
  <pre><code>#!/usr/bin/env perl
  use warnings;
  use strict;
  use utf8;
  use open qw(:utf8 :std);
  use Encode qw(decode_utf8);
  
  # ...
  
  if ( not eval{
      # some error-messages (utf8) are decoded some are not
      1 }
  ) {
      if ( utf8::is_utf8 $@ ) {
          print $@;
      }
      else {
          print decode_utf8( $@ );
      }
  }
  </code></pre>