[Israel.pm] The syntax role of the colon (':')

Meir Guttman meir at guttman.co.il
Sun Sep 16 01:15:10 PDT 2012

Thank you Gaal!

Your pointer is excellent! Googling for «perlio» yielded a lot of useful links.

Of these I found that the most useful start in “Mojolicious”.  My recommended steps are:

1.       Start with Mojolicious’ “perliol” document’s “Basic Structure”: http://mojolicio.us/perldoc/perliol#Basic_Structure 

2.       Go to the PERLIO section in Mojolicious’ “perlrun”: http://mojolicio.us/perldoc/perlrun#PERLIO (Why is this architectural introduction in the document that explains how to run the Perl interpreter is a mystery to me…).
In that section there is a direct answer to my question, to quote:

A space (or colon) separated list of PerlIO layers. If perl is built to use PerlIO system for IO (the default) these layers effect perl's IO.

It is conventional to start layer names with a colon e.g. :perlio to emphasize their similarity to variable "attributes". But the code that parses layer specification strings (which is also used to decode the PERLIO environment variable) treats the colon as a separator.

3.       Follow with Mojolicious’ PerlIO doc (http://mojolicio.us/perldoc/PerlIO) 

4.       Then follow any of these documents’ “See also...” to your heart’s content!

Good reading, thank you all Shana Tova and Gmar Khatima Tova!



From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Gaal Yahas
Sent: שבת 15 ספטמבר 2012 21:50
To: Perl in Israel
Subject: Re: [Israel.pm] The syntax role of the colon (':')


These are perlio layers. man PerlIO has the story.


You can use this to encode/decode charsets on the fly; normalize newlines; compress/decompress and so on.

On Sat, Sep 15, 2012 at 7:43 PM, Meir Guttman <meir at guttman.co.il> wrote:

Hey folks!

Every once in a while I encounter the colon (‘:’) as part of the Perl syntax.

Examples are «binmode STDOUT, ":utf8";» and «open my $ini_fh, "<:encoding(utf8)", $node_ini_fn; ».

(Well, except the double colon as a directory-tree separator replacement.)

Can anybody elucidate?


Shana Tova and Gmar-Khatima Tova,



Perl mailing list
Perl at perl.org.il


Gaal Yahas <gaal at forum2.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20120916/894a2e46/attachment.htm 

More information about the Perl mailing list