in reply to Since JAPH seems to be popping out all over

You know what's interesting is the way in which B::Deparse breaks this obfu. In specific, Deparse breaks the portion that goes like this: $|[ $a++ ] = chr $;;. Deparse turns that into $|[ $a++ ] = chr $;. The important difference is the missing statement terminator, ';'. After being deparsed, until I manually add that back in, I get the following:

Scalar found where operator expected at mytest2.pl line 16, near "$; $;" (Missing operator before $;?) syntax error at mytest2.pl line 16, near "$; $; " Execution of mytest2.pl aborted due to compilation errors.

I know the old mantra is "Only perl can parse Perl", and this is an example of that being the case. I'd say it's a bug in B::Deparse, but then we can't expect it to be perfect, especially when presented with an obfu. I'm just surprised that it got tripped up by something so trivial as a statement terminating semicolon.


Dave

Replies are listed 'Best First'.
Re^2: Since JAPH seems to be popping out all over
by whio (Beadle) on Feb 06, 2005 at 07:59 UTC
    Yes, I happened across that mostly by accident when I was crafting this. It's not much of a break (if you're going to be running B::Deparse on this, you're going to be able to correct the output it gives you) but I figured it was worth leaving in.

    I suspect that something in Deparse mistakes $; as including the statement-terminating semicolon, particularly as it occurs on the end of a line. This is just guessing, though, as I have not really experimented with it much.