After discussing this briefly in the chatterbox, it seems like it would be an interesting enough challenge for the JAPHs out there...

Given the string: $japh = "Just Another Perl Hacker";, perform one substitution on it, with something like: $japh =~ s/whatever/whatever_else/;, such that $japh now contains the string "s/whatever/whatever_else/".

Entries will be judged on creativity, functionality, and level of obfuscation. ;)

Replies are listed 'Best First'.
Re: A call for a new breed of obfuscation
by cwest (Friar) on Jan 16, 2001 at 01:42 UTC
    $japh = 'Just another Perl Hacker'; $_.=q;$\='\n'\;$/=\'\;'\;$,.=\$\\\; $japh =~ s/Just another Perl/YAP/s; ;y;~;;d;y;';";;s;\b(s);$\;++\;$\;== 1?"'$1":"$1'";exg;eval;print $japh;
    Round Two, Ding!
    --
    Casey
       I am a superhero.
    
Re: A call for a new breed of obfuscation
by c-era (Curate) on Jan 16, 2001 at 18:08 UTC
    Here is an easy one:
    $japh="Just Another Perl Hacker"; $a='s/.*/$a/'; $japh=~s/.*/$a/; print $japh;
Re: A call for a new breed of obfuscation
by cwest (Friar) on Jan 16, 2001 at 01:04 UTC
    $japh = 'Just another Perl Hacker'; *_=*DATA;seek _,print,s/Just anothe r/Perl Hacker/x,;($/,$\)=(',',"\n") ,*_=*{join$',map{lc}map{$_=+reverse ;chop}split/\s+/=>$japh}=\(<_>)[2]; s$(\$\)$$;chomp;print$japh,__DATA__
    First pass, I'll try again.

    Note:The above code is sensitive. It must be in a file when run.

    --
    Casey
       I am a superhero.
    
Re: A call for a new breed of obfuscation
by BooK (Curate) on Jan 16, 2001 at 05:17 UTC

    It looks like you want some kind of Quine...

    I am not sure I am good enough for this (not at 1am at least)...

Re: A call for a new breed of obfuscation
by c-era (Curate) on Jan 16, 2001 at 18:26 UTC
    And another easy one (I figured I better get them out of the way).
    $japh="Just Another Perl Hacker"; $japh=~s/Just Another Perl Hacker/seek (DATA,$^Oeq"MSWin32"?42:41,0);s +printf <DATA>;/e ;print $japh; __DATA__