user-pic

Scott Lanning

  • Commented on obfuscating Perl for fun and profit
    Nice. I got it to work (print 1 - 100) with: $_%(int($^F*($^F**$^F)+$^F)*int($^F*($^F**$^F)+$^F)+$^F**0)?say:exit (note: $_ is time-$^T rather than $^T, and +$^F**0 adds 1 to make 101, since it exits after printing 100) I kinda dislike the overall $n ? say...
  • Commented on ()
    Thanks!...
  • Posted obfuscating Perl for fun and profit to Scott Lanning

    (apologies for "promoting"(?) Perl obfuscation...)

    Today I won a gift card at an in-office meeting with the following code. Challenge: print the numbers 1-100 in the most incomprehensible, inefficient way. My entry, edited for brevity:

    #!/usr/bin/env perl
    use v5.16;
    spl…

  • Commented on ()
    Thanks!...
  • Posted () to Scott Lanning

    $ perl -Mstrict -we'$_ = time; print "$_\n"'

    <.<

    $ perl -Mstrict -we'$_ = CORE::time; print "$_\n"'
    1583887039

    >.>

    $ perl -Mstrict -we'$_ = time - CORE::time; print "$_\n"'
    0

    -_- ...

    $ perl -Mstrict -we'BEGIN{*CORE:…

Subscribe to feed Recent Actions from Scott Lanning

  • Veesh commented on ()

    Wow, it took reading this twice, but that was actually a fantastic post.

  • The Mighty Buzzard commented on obfuscating Perl for fun and profit

    I guess you could nest some extra ternary statements there to make it more confusing but I can't think of any good ones at the moment. Something that always evaluates to "exit" but does it an extremely impractical way. Maybe building the ascii codes for the word "exit" with some pointless math, chr them, put them into an array, run a join on the array, and then eval the end result scalar.

    It's still a solid operation for obfuscated perl code though, especially without the traditional spacing, on account of about a quarter of the people looking at it will have to take a moment to unde…

Subscribe to feed Responses to Comments from Scott Lanning

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.