Next You can't get there from here 36

Anything

 sub halts {
 my ($source_code, $input) = @_;
 my $newcode = q{sub { my $n = shift;
 my $f = eval "CODE";
 $f->("INPUT");
 return $n * $n;
 }};
 $newcode =~ s/CODE/$source_code/;
 $newcode =~ s/INPUT/$input/;
 return calculates_squares($newcode);
 } 
 sub halts {
 my ($source_code, $input) = @_;
 my $newcode = q{sub { my $f = eval "CODE";
 eval { $f->("INPUT"); }
 die "BOOGA BOOGA!";
 }};
 $newcode =~ s/CODE/$source_code/;
 $newcode =~ s/INPUT/$input/;
 return dies($newcode);
 } 

Next Copyright © 2005 M. J. Dominus

AltStyle によって変換されたページ (->オリジナル) /