Are leading colons, really, proper part of IO layers names?

Are they just separators between layers and/or file opening mode, when these things are written as single string, chained together? And then, they (colons) are somehow stuck in front of every name, when such a name is mentioned in documentation? Moreover, it even appears that it was done on purpose to help reading, so that names stand out in text, as in "Look, I'm an IO layer name!"

PerlIO, binmode, etc. have leading colon as part of each name. However, PerlIO in its second part stops prepending colons.

Looks like everything (with exception, see further) works OK without colons:

D:\>perl -wE "binmode STDOUT, 'utf8'; use open IO => 'raw'" D:\>perl -wE "say for PerlIO::get_layers(STDOUT)" unix crlf D:\>perl -wE "use open ':utf8';" # OK D:\>perl -wE "use open 'utf8';" # OK D:\>perl -wE "use open 'encoding(ASCII)';" # OK D:\>perl -wE "use open ':encoding(ASCII)';" # OK D:\>perl -wE "use open ':std';" # OK D:\>perl -MPerlIO -wE "use open 'std';" Unknown PerlIO layer class 'std' (need IN, OUT or IO) at -e line 1. BEGIN failed--compilation aborted at -e line 1.

Because it's not really a layer name, but 'subpragma' (??), to be used as:

D:\>perl -wE "use open ':std' => 'utf8';"

In reply to Colons in names of IO layers by vr

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.