Recent releases of Perl opened a new avenue of exploration the dark corridors of which I will probably never tread again after finding nothing but trouble on this my first expidition. This obfu has been thoroughly fumigated, and thus is safe, but not necessarily sound. I wouldn't expect much if you're running pre 5.8.0, and even those with more recent versions have had mixed results. I hesitated posting it, but I'm mostly curious to hear about its behavior.

$|=$i{rek}=q;>;x2;;$i=join"",map{(split//,"tsuJ")[$_]}(split//,3210); open i,$i{rek},\$i;print i" another lreP";close i;($;,$:)=$i=~m=^(.+ \s)(\s\S+)$=x;$i{caH}=open i,$i{rek},\$;;@_=map{scalar reverse$_}sort keys%i;print i+scalar(reverse$:),@_[0,-1],$/;close i;print$;

UPDATE: This obfu is based on features only available in 5.8.0 and beyond. Earlier Perl versions just won't do anything. Even for users of 5.8.0, some tinkering may be needed to get the desired output. If you find that it doesn't work by running it as "perl obfu", try it is "perl -w obfu". And if that doesn't work, put a shebang line at the top and run it simply as "obfu" (or whatever you want to name the file). The point is, it's known to be tempermental.

Read on to find out why it might be so tempermental...

This JAPH relies on the open function's ability to open a file to memory (rather than physical storage) by passing a reference to a scalar where one would normally pass a filename. The perldocs discuss doing this, and show such a "memory file" being opened in ">" mode. I'm opening it in ">>" (append mode) and writing to it a couple of times. After each write I close the filehandle so that the buffer gets flushed. I also have $| set, to autoflush. Nevertheless, this JAPH *may* (or may not) suffer from a dirty buffer situation, so your mileage may vary. It *should* work (from what I know), but clearly there's more than meets the eye in this newly implemented "feature".

Dave

"If I had my life to do over again, I'd be a plumber." -- Albert Einstein

Replies are listed 'Best First'.
Re: Opening the door to smoke.
by castaway (Parson) on Oct 02, 2003 at 08:52 UTC
    *boggle*
    castaway@desert-island:/home/castaway > perl5.8.0 perl/davidoobfu.pl Hacker castaway@desert-island:/home/castaway > perl5.8.0 -w perl/davidoobfu.p +l Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 2. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 2. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 2. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 3. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 4. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 4. Argument ">>" isn't numeric in scalar assignment at perl/davidoobfu.pl + line 1. Just another Perl Hacker castaway@desert-island:/home/castaway > perl5.8.1 perl/davidoobfu.pl Just another Perl Hacker castaway@desert-island:/home/castaway > perl5.8.1 -w perl/davidoobfu.p +l Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 2. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 2. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 2. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 3. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 4. Unquoted string "i" may clash with future reserved word at perl/davido +obfu.pl line 4. Argument ">>" isn't numeric in scalar assignment at perl/davidoobfu.pl + line 1. Use of uninitialized value in list assignment at perl/davidoobfu.pl li +ne 2. Use of uninitialized value in open at perl/davidoobfu.pl line 3. Hacker
    *huh*

    C.

Re: Opening the door to smoke.
by jonadab (Parson) on Oct 04, 2003 at 00:22 UTC

    It works for me here, when invoked as perl davido.pl, using ActiveState 5.8.0, with or without the shebang. Also works with -w but in that case spits a bunch of warnings in addition to the intended text.


    $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/