### Comment on

 Need Help??

I remember this trick being employed in early golf games, though it was never given a name to the best of my knowledge. Searching the secret Terje/mtv pdf book of Perl Golf reveals five uses of this secret operator:

08-jun-2002: Piers Cawley, section 4.5, TPR(0,4) Interlinear Counts

```-ap056 sub b{\$_=lc;y/aeiouy//."/".y/a-z0-
9//}\$c=\$b=':^I';map{\$c.=pack\$l=A.((\$l=y///c)>3?++\$l:4),\$_;\$b.=pack\$l,b
+}@F;\$c
=~s/(.{59})...+\S.*/\$1.../&&\$b=~s/(.{58}\S*).*/\$1/;\$_=(@F."\$c
".b."\$b
")x!!@F;s/ *\$//mg
19-jul-2002: Ton Hospel, section 3.11, Terje's Cryptoanalysis
```-n0 for\$n(A..Z){\$;[pos=-split/\$n/i].="\$n \$#_\n"x!!\$#_}print@
17-jan-2003: Ton Hospel, section 5.20, LED Display
```y/01/ #/,@F=/.../g,print"@F[@_]
"for unpack'(b30)*','\xE7\xDF\xFF?%\xD9\x84-
\xE5\xFF\x9F?eH\x96%\xE7\xCF\x9F?'x!!split//,pop
23-may-2003: Michal Jankowski, section 8.13, DEKODER
```-nl sub J{map\$_[\$s-\$_].=pop,1..\$s;@_}\$s=8;sub
S{/./g;\$&^t||!(\$s/=2)?(\$&x\$s)x\$s:(J(&S,&S),J&S,&S)x!!(\$s*=2)}print for
+ S
16-sep-2003: Mtv Europe, section 6.9, Huffman Codes
```-pa (\$~,\$;,@F)=sort{\$a-\$b}@F,(\$c=\$~+\$;)x!!s/\b\$~\b|\b(\$;)\b/\$c,\$#-
/gwhile\$;;s/\$c|,//g

Update: It was also used by Ton Hospel and Mtv Europe in May 2003 to produce the shortest known Perl solution to 99 bottles of beer:

```sub
b{[@b=(abs||No,bottle."s"x!!++\$_,of,beer),on,the,wall]}print
"@{+b},\n@b,\nTake one down, pass it around,\n@{+b}.\n"
for-pop||-99..-1

Notice that in golf, and different from Aristotle's example, the x!! secret operator is most commonly used in scalar context -- in the 99 bottles of beer example, it's used to generate either "s" or "", thus forming either "bottles" or "bottle". Sometimes golfers rely on the ! operator returning "" (and not 0) for false. AFAICT, this behaviour is not guaranteed anywhere in the official Perl docs, though it's mentioned in the Camel, in the "Ideographic Unary Operators" section, page 92:

Unary ! performs logical negation, that is, "not". See not for a lower precedence version of logical negation. The value of a negated operand is true (1) if the operand is false (numeric 0, string "0", the null string, or undefined) and false ("") if the operand is true.

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.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, 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: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
 [TCLion]: I am breaking down the line and putting the date in the correct order during output [TCLion]: at least that's the plan [1nickt]: Corion this looks good, from the pod: "there are 9000+ variations that are detected correctly in the test files (see t/data/* for most of them). If you can think of any that I do not cover, please let me know." [TCLion]: some moron put the date like this : Mon Feb 20 09:31:30 2017 [Corion]: 1nickt: Yes, the module sounds promising indeed [1nickt]: "putting the date in correct order" how? [Corion]: TCLion: Whee ;) [TCLion]: need to put like this : 2017-02-20 09:30:53 [1nickt]: That's why I asked if you are using DateTime. It has a large number of supporting modules (the author likes the term 'eco-system') so if you are already creating a DateTime obj from your dates, this module would read in the mnoron-formatted 1s seamlessly [TCLion]: when I put the date together it looks like : 2017-Feb-24 (month is the problem)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (14)
As of 2017-03-23 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (288 votes). Check out past polls.