<?xml version="1.0" encoding="windows-1252"?>
<node id="1005848" title="Re: Perl allows package names consisting entirely of colons" created="2012-11-27 08:06:24" updated="2012-11-27 08:06:24">
<type id="11">
note</type>
<author id="968231">
Athanasius</author>
<data>
<field name="doctext">
&lt;p&gt;Seems to work only when the colons come in pairs:&lt;/p&gt;

&lt;code&gt;
#! perl
use strict;
use warnings;

package :::::
{
    sub x
    {
        printf "(%s)\n", __PACKAGE__;
    }
}

package main;

:::::::x();
&lt;/code&gt;

&lt;p&gt;Produces:&lt;/p&gt;

&lt;code&gt;
23:01 &gt;perl 405_Obfu.pl
Bareword "::::::" refers to nonexistent package at 405_Obfu.pl line 27.
Invalid version format (non-numeric data) at 405_Obfu.pl line 17, near "package ::::"
syntax error at 405_Obfu.pl line 17, near "package :::::"
Execution of 405_Obfu.pl aborted due to compilation errors.

23:02 &gt;
&lt;/code&gt;

&lt;blockquote&gt;&lt;i&gt;&amp;ldquo;Curiouser and curiouser!&amp;rdquo; cried Alice.&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; &lt;strike&gt;D&amp;rsquo;oh! (&lt;i&gt;slaps forehead&lt;/i&gt;). Of course! &lt;tt&gt;::&lt;/tt&gt; is a synonym for &lt;tt&gt;main&lt;/tt&gt;, and so is &lt;tt&gt;::main&lt;/tt&gt; and therefore &lt;tt&gt;::::&lt;/tt&gt;, likewise &lt;tt&gt;::::::&lt;/tt&gt;, etc., etc. (See [doc://perlmod#Packages].)&lt;/strike&gt; This &amp;ldquo;insight&amp;rdquo; is wrong &amp;mdash; see reply by [tobyink], below.&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-968231"&gt;
&lt;p&gt;Athanasius&amp;emsp;&lt;font color=#008000&gt;&amp;lt;&amp;deg;(((&amp;gt;&amp;lt;&lt;/font&gt;&amp;emsp;&lt;i&gt;contra mundum&lt;/i&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1005846</field>
<field name="parent_node">
1005846</field>
</data>
</node>
