Runs under both BASIC (tested with yabasic-2.66) and perl. Neither "-w" or "use strict;" is very happy with it though :)
Update: Based on this reply from BooK, here's something a little closer to a polyglot:REM ;for(<DATA>){ REM ; chomp;s;\c0\$;\$\c0;;s; ^\d0;;x; REM ; s;(\w)\w+\$\(;\1\(;x;/(\d+),(\d+)/||{$;=$1,/(\d)/}; REM ; $2?{$==$1-1,$:=$2}:{$:=$1,$==0,$;eq"r"&&{$=-=$:}}; REM ; s;$1,*\d*;$=,$:;;$:&&s;\w\(;substr\(;;eval;} REM ; print "\n"; REM ;__DATA__ 10 p$="hack another just perler" 20 print mid$(p$,14,4); 30 print mid$(p$,5,8); 40 print mid$(p$,18,5)," "; 50 print left$(p$,4); 60 print right$(p$,2)
REM ;$_=<<REM; sub japh() REM REM ; $_.="{" . <<'REM ;'; print "Just another Perl hacker\n"; REM ; REM ;$_.="}";eval;<<'REM'; end sub REM japh()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: BASIC hajp
by BooK (Curate) on Jan 19, 2001 at 00:50 UTC | |
by kschwab (Vicar) on Jan 19, 2001 at 01:02 UTC |