Next You can't get there from here 24

"Is my program going to finish?"

        $CODE = "sub { 
                   my $arg = shift;
                   ... do something with $arg ...
                   ... return some result ...
                   ... (or not) ...
                 }";
        $INPUT = "carrots";
        sub halts {
          my ($source_code, $input) = @_;
          ... do something clever ...
          ... return true if the function finishes when given '$input'
          ... return false if not
        }

Next Copyright © 2005 M. J. Dominus