###Perl, 89 chars, no cheating
Perl, 89 chars, no cheating
$_=q($_=q(Q);s/Q/$_/;($q=join"",<>)eq$_?die:eval$q);s/Q/$_/;($q=join"",<>)eq$_?die:eval$q Note that this code is extremely picky about what counts as "itself". In particular, it will not recognize itself if there are any trailing newlines or other extra whitespace in the input. To test it, save it into a file named (for example) unquine.pl and do this:
$ perl unquine.pl unquine.pl Died at unquine.pl line 1, <> line 1. Remember, the unquine.pl file should be exactly 89 bytes long, no more, no less. Running it with some other Perl script as input just executes the other script, as it should:
$ perl unquine.pl hello.pl Hello, world! As the name might suggest, the implementation is based on a quine — specifically, this one:
$_=q($_=q(Q);s/Q/$_/);s/Q/$_/ This code sets $_ equal to itself; the rest of the program (which, of course, must be duplicated inside $_) just compares $_ to the input, dies if they match and evaluates the input otherwise.