<?xml version="1.0" encoding="windows-1252"?>
<node id="773791" title="Re: Hidden features of Perl" created="2009-06-22 19:44:44" updated="2009-06-22 19:44:44">
<type id="11">
note</type>
<author id="176576">
eyepopslikeamosquito</author>
<data>
<field name="doctext">
&lt;P&gt;
Some old PM nodes I remember that seem relevant:
 &lt;ul&gt;
  &lt;li&gt; [id://426037]
  &lt;li&gt; [id://564792]
  &lt;li&gt; [id://525392]
 &lt;/ul&gt;
&lt;/P&gt;

&lt;P&gt;
From [id://437032], some "hidden golfing features":
&lt;CODE&gt;
Golfing Technique                     Inventor           Year
-----------------                     --------           ----
@{[]}  aka ???                        The Larry or       1994
                                      The Schwartz
}{     aka eskimo greeting            The Abigail        late 1990s
~~     aka inchworm                   ???
~-     aka inchworm-on-a-stick        The Hospel         2002
$_ x= boolean expression              The Larry          early 1990s
y///c aka Abigail's Length Horror     The Hall           1996
stuff value into $\ for printing      The van der Pijll  2001
}for(...){ variation of eskimo        The Hospel         2001
--$| magical flip-flop                The Hospel         2002
\$h{X} is one less than ++$h{X}
       aka Thelen's Device            The Thelen         2002
-i and $^I for data value             The Sperling       2002
&lt;/CODE&gt;
&lt;/P&gt;

&lt;P&gt;
&lt;B&gt;Update:&lt;/B&gt; [BooK] has recently popularized a new set of secret operators,
the &lt;a href="http://www.nntp.perl.org/group/perl.golf/2009/06/msg2524.html"&gt;screwdriver operators&lt;/a&gt;:
&lt;CODE&gt;
-=! and -=!!        - flathead
+=! and +=!!        - phillips
*=! and *=!!        - torx

x=! and x=!!        - pozidriv (http://en.wikipedia.org/wiki/Pozidriv)

This is a conditional "set to empty string" operator
(the string equivalent of the torx):

$x x=!! $y  is same as $x = '' unless $y;
$x x=!  $y       --    $x = '' if $y;
&lt;/CODE&gt;
These screwdriver operators follow on from earlier secret operator work, such as Dmitry Karasik's
&lt;a href="http://www.nntp.perl.org/group/perl.fwp/2007/11/msg4028.html"&gt;original set of "!"-based secret operators&lt;/a&gt; and [BooK]'s &lt;a href="http://www.nntp.perl.org/group/perl.fwp/2007/11/msg4006.html"&gt;flaming X-wing operator&lt;/a&gt; (&lt;CODE&gt;@data{@fields} =&lt;&gt;=~ $re&lt;/CODE&gt;).
&lt;/P&gt;

&lt;P&gt;
&lt;B&gt;March 2012 Update:&lt;/B&gt; [BooK] at it again, this time proposing a new
&lt;a href="http://www.nntp.perl.org/group/perl.fwp/2012/03/msg4169.html"&gt;sperm secret operator&lt;/a&gt;. An alternative name is the "kite" secret operator.
&lt;/P&gt;

&lt;P&gt;
From
&lt;a href="https://github.com/book/perlsecret"&gt;BooK "perlsecret - Perl secret operators and constants" draft man page&lt;/a&gt;:
&lt;/P&gt;

&lt;P&gt;
Perl secret operators:
&lt;CODE&gt;
Operator     Nickname                Function
================================================
0+           Venus                   numification
@{[ ]}       Babycart                list interpolation
!!           Bang bang               boolean conversion
}{           Eskimo greeting         END block for one-liners
~~           Inchworm                scalar
~-           Inchworm on a stick     high-precedence decrement
-~           Inchworm on a stick     high-precedence increment
-+-          Space station           high-precedence numification
=( )=        Goatse                  scalar / list context
=&lt; &gt;=~       Flaming X-Wing          match input and assign captures
~~&lt;&gt;         Sperm
&lt;&lt;m=~&gt;&gt; m ;  Ornate double-bladed sword
-=!   -=!!   Flathead
+=!   +=!!   Phillips
x=!   x=!!   Pozidriv
*=!   *=!!   Torx
&lt;/CODE&gt;
&lt;/P&gt;

&lt;P&gt;
Perl secret constants:
&lt;CODE&gt;
Constant     Nickname                Value
=================================================
&lt;=&gt;&lt;=&gt;&lt;=&gt;    Space fleet             0
&lt;~&gt;          Amphisbaena             $ENV{HOME}
&lt;/CODE&gt;
&lt;/P&gt;

&lt;P&gt;
See also [id://959855].
&lt;/P&gt;
</field>
<field name="root_node">
773443</field>
<field name="parent_node">
773443</field>
</data>
</node>
