title: Perl Stop Print if Wide Characters Error
body: <p>I have a simple print script </p>
  
  <pre><code>my $pdf_data = $agent-&gt;content;
  open my $ofh, '&gt;:raw', "test.pdf"
  or die "Could not write: $!";
  print {$ofh} $pdf_data;
  close $ofh;
  </code></pre>
  
  <p>Sometimes I get the "Wide character warning", I know why I receive this and would like to be able to cancel the print instead of printing a corrupted fail.  Something like</p>
  
  <pre><code>if(wideCharWarning)
  {
  delete "test.pdf"
  }
  else{
  print {$ofh} $pdf_data;
  }
  </code></pre>