in reply to Better labeling of obfuscated code section

q{ Obviously perl golf is a game, in stark contrast to Best Practices. }

This is the disclaimer that I attach whenever I show off golfs... it does appear on my scratchpad (although It should be part of my sig too, I guess)

I'm 100% sure that those who write golfs don't use them in production. The only ones in question are those who look at an obfu and want to write their own and haven't encountered one in the wild yet... Perl programmers are smart enough to know that someone's going to have to read it...

The langauge is both a toy and a tool, people will saw their own arms off if they start playing with chainsaws, the same thing applies to obfus.

TheDamina opens PBP with q{ Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live }

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Replies are listed 'Best First'.
Re^2: Better labeling of obfuscated code section
by clinton (Priest) on Aug 12, 2007 at 11:17 UTC
    I'm 100% sure that those who write golfs don't use them in production.
    The same can't be said for those who don't write golfs...

    11 years ago, shortly after starting to use Perl, my client demanded that I implement "encryption". I had no idea how encryption worked, or how to implement it in Perl. CPAN was young, and not nearly as rich as it is today.

    So I searched Google, and found this: RSA in 3 lines:

    #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1 lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

    This was used by my client for years to encrypt and transport customer data from a website via FTP.

    It worked, but I wouldn't recommend the practice :)

    Clint

      Yes, the same is true of golfs as of obfus... they can get you in trouble in a production environment.

      I'm surprised you didn't wake up one night with an axe in your spine, and an angry man in a black tshirt standing over you ranting about revenge...

      You were lucky this time ;)

      @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;