Perl secret operators and constants
search.cpan.org
Perl secret operators and constants
1–10 of 46 posts
Re: Perl secret operators and constants
#2Reading this actually makes me feel like my company has done a good job of outlawing the "write-only" type of perl.
Would this be valid?
$x +=!! ==~ s/readable-code//g;
Re: Perl secret operators and constants
#3Perl seems like a great language for a lot of text processing jobs, but while its learning curve isn't too steep, it goes on forever. I will continue to use it for quick little projects like cleaning up excel files, but I don't think I could ever get into things like Perl golf.
Re: Perl secret operators and constants
#4I write perl everyday, I never use this stuff.
Re: Perl secret operators and constants
#5Reading this actually makes me feel like my company has done a good job of outlawing the "write-only" type of perl. Would this be valid? $x +=!! = =~ s/readable-code//g;
It kind of looks valid to me, yes.
Re: Perl secret operators and constants
#6I once managed to get some obfuscated Perl into an official Red Hat document (as a subtle joke): https://access.redhat.com/documentation/en-US/Red_Hat_Enterp... (search for "simple perl").
Re: Perl secret operators and constants
#7Reading this actually makes me feel like my company has done a good job of outlawing the "write-only" type of perl. Would this be valid? $x +=!! = =~ s/readable-code//g;
No, for the same reason that $x += = 3 is invalid.
Re: Perl secret operators and constants
#8It's articles like this that give Perl a bad reputation.
Re: Perl secret operators and constants
#9I once managed to get some obfuscated Perl into an official Red Hat document (as a subtle joke): https://access.redhat.com/documentation/en-US/Red_Hat_Enterp... (search for "simple perl").
I am not sure I would call this obfuscated. The only real confusing piece of that code is if the reader doesn't know that you can use most punctuation characters with s///g
Re: Perl secret operators and constants
#10if nothing else, most of these operators have immense nicknames. Now I just need an excuse to involve a flaming x-wing in my code...
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
==~ Flaming X-Wing match input, assign captures
~~ Kite a single line of input
> m ; Ornate double-bladed sword multiline comment
-=! -=!! Flathead conditional decrement
+=! +=!! Phillips conditional increment
x=! x=!! Pozidriv conditional reset to ''
*=! *=!! Torx conditional reset to 0
,=> Winking fat comma non-stringifying fat comma
()x!! Enterprise boolean list squash
0+!! Key to the truth numeric boolean conversion
~~!! Serpent of truth numeric boolean conversion
||() Abbott and Costello remove false scalar from list
//() Leaning Abbott and Costello remove undef from list