in reply to JA(C|P)H
This uses a few tricks to convert C into valid Perl. You can also do some tricks in the opposite direction using #define. Unfortunately you're limited by the fact that $ and (I think) @ are not valid characters in C code. However, gcc allows them so if you don't mind restricting the C code to gcc compilation you have more freedom.
#include <stdio.h> main() #ifdef __PERL__ ;sub main {} my $i; sub i:lvalue {$i} #endif { int i; for(i = 0; (i) < 10; (i)++){ printf("%d\n",i); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: JA(C|P)H
by ktross (Deacon) on Mar 23, 2005 at 13:35 UTC |
In Section
Obfuscated Code