use strict; print "what is the value of i:"; chomp(my $i=<>); print"\n"; print "what is the value of j:"; chomp(my $j = <>); print "\n"; my $ackerman = &ackerman($i,$j); print "A($i,$j) = $ackerman\n"; sub ackerman{ my $i=shift; my $j = shift; if($i == 1){ undef $i; return 2**$j; } elsif($j==1){ undef $j; return &ackerman($i-1,2); } else{ return &ackerman($i-1,&ackerman($i,$j-1)); } }