<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title><![CDATA[Perl 6: WITCH hat]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?witch_hat</link>
<description></description>
<pubDate>Fri, 25 Jan 2008 02:38:28 -0000</pubDate>
<webMaster>synedra@gmail.com</webMaster>
<generator>Socialtext Workspace v2.14.7.2</generator>

<item>
<title><![CDATA[WITCH hat]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?witch_hat</link>
<description><![CDATA[<div class="wiki">
<h1 id="mnemonics">Mnemonics</h1>
<p>
&quot;hat&quot;, &quot;disjunct&quot;, &quot;but not&quot;, &quot;upto&quot;</p>
<p>
 -- Used when something &quot;wears many hats&quot;<br />
 -- Also used in exclusive or and other disjunctions (you can only wear one hat at a time)</p>
<hr />
<h1 id="used_alone">Used alone</h1>
<p>
<span class="nlw_phrase">^<!-- wiki: {{^}} --></span> Before a value, the <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S03.html#Symbolic_unary_precedence">upto operator<!-- wiki-renamed-hyperlink "upto operator"<http://perlcabal.org/syn/S03.html#Symbolic_unary_precedence> --></a> (a <a target="_blank" title="(external link)" href="http://en.wikipedia.org/wiki/The_500_Hats_of_Bartholomew_Cubbins">Bartholomew Cubbins<!-- wiki-renamed-hyperlink "Bartholomew Cubbins"<http://en.wikipedia.org/wiki/The_500_Hats_of_Bartholomew_Cubbins> --></a> hat)<br />
<span class="nlw_phrase">^<!-- wiki: {{^}} --></span> Before a package name is <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S12.html#Classes">shorthand for introspection<!-- wiki-renamed-hyperlink "shorthand for introspection"<http://perlcabal.org/syn/S12.html#Classes> --></a> (lets you see its hat collection.)<br />
<span class="nlw_phrase">^<!-- wiki: {{^}} --></span> In a junction creates a <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S03.html#Junctive_or_(any)_precedence">one() junction<!-- wiki-renamed-hyperlink "one() junction"<http://perlcabal.org/syn/S03.html#Junctive_or_(any)_precedence> --></a></p>
<h1 id="operators_containing_this_character">Operators containing this character</h1>
<p>
<span class="nlw_phrase">~^ and +^ and ?^<!-- wiki: {{~^ and +^ and ?^}} --></span> An exclusive or bitwise operation (or an invert, if only one argument)<br />
<span class="nlw_phrase">^<!-- wiki: {{^}} --></span> placed on either or both ends of a range (..) or flip-flop range (ff or fff) to exclude (or &quot;cap&quot;) the endpoints<br />
<span class="nlw_phrase">.^<!-- wiki: {{.^}} --></span> as a method is also <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S12.html#Introspection">for introspection<!-- wiki-renamed-hyperlink "for introspection"<http://perlcabal.org/syn/S12.html#Introspection> --></a><br />
<span class="nlw_phrase">^^<!-- wiki: {{^^}} --></span> <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S03.html#Tight_or_precedence">tight logical exclusive-or<!-- wiki-renamed-hyperlink "tight logical exclusive=-or"<http://perlcabal.org/syn/S03.html#Tight_or_precedence> --></a></p>
<h1 id="when_used_inside_regexes">When used inside regexes</h1>
<p>
<span class="nlw_phrase">^<!-- wiki: {{^}} --></span> Matches the <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S05.html#Changed_metacharacters">start of a string<!-- wiki-renamed-hyperlink "start of a string"<http://perlcabal.org/syn/S05.html#Changed_metacharacters> --></a><br />
<span class="nlw_phrase">^^<!-- wiki: {{^^}} --></span> Matches the <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S05.html#New_metacharacters">start of a line<!-- wiki-renamed-hyperlink "start of a line"<http://perlcabal.org/syn/S05.html#New_metacharacters> --></a></p>
<h1 id="special_variables">Special Variables</h1>
<p>
Variable names starting with hats inside a pointy block or sub are <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S06.html#Placeholder_variables">placeholder variables<!-- wiki-renamed-hyperlink "placeholder variables"<http://perlcabal.org/syn/S06.html#Placeholder_variables> --></a><br />
Method names declared with hats are metaclass methods</p>
<h1 id="other_uses">Other Uses</h1>
<p>
Method names starting with hats are <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S12.html#Class_methods">metaclass methods<!-- wiki-renamed-hyperlink "metaclass methods"<http://perlcabal.org/syn/S12.html#Class_methods> --></a></p>
<h1 id="old_deprecated_or_other_language_uses">Old, deprecated, or other language uses</h1>
<p>
<span class="nlw_phrase">^<!-- wiki: {{^}} --></span> was bitwise exclusive or in Perl 5. In Perl 6 that's ~^, +^, or ?^ for bitwise, and ^^ in logic.<br />
Lots of special variables in Perl 5 started with ^. Not only are those gone, but <a target="_blank" title="(external link)" href="http://perlcabal.org/syn/S06.html#Placeholder_variables">placeholders cannot have single uppercase names<!-- wiki-renamed-hyperlink "placeholders cannot have single uppercase names"<http://perlcabal.org/syn/S06.html#Placeholder_variables> --></a></p>
</div>
]]></description>
<author>Brian Julin</author>
<guid isPermaLink="true">http://www.perlfoundation.org/perl6/index.cgi?witch_hat</guid>
<pubDate>Fri, 25 Jan 2008 02:38:28 -0000</pubDate>
</item>

</channel>
</rss>