I've not seen -C options before today, but they're all documented here quite nicely: http://perldoc.perl.org/perlrun.html. I might find a use for them myself...

The option to use UTF-8 for STDOUT breaks down when trying to output anything other than text: The 'U' is for Unicode, which implies text data.

Image files aren't text (as usual, there are some esoteric exceptions, but in general...) so putting them through a UTF-8 encoder is like running a gamma correction on a perl script.

In this case, I'd suggest that you have two reasonable options:

  1. Stick with your current approach (default to UTF-8 with the -COE options, and switch to ":raw" when you need to output non-text), or
  2. Remove the -C option completely, and defer selection of ":utf8" or ":raw" until the point at which your code is able to identify what it's going to be outputting.

In reply to Re: perl -COE and, for example, CGI::Application by wol
in thread perl -COE and, for example, CGI::Application by isync

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.