in reply to how to program my program to add random numbers?

As far as I see, there are no mistakes in that it produces what is asked. I wouldn't code it that way though. And I'd do some checking of the input. For instance, by using IO::Prompt:
#!/usr/bin/perl use 5.010; use strict; use warnings; use IO::Prompt; my @operand; foreach my $word (qw[a another]) { push @operand, prompt -p => "Type in $word number: ", '-num'; } prompt -p => "What would you like done?", '-1', -menu => [qw[Add Subtract Multiply Divide]]; my $op = {qw[Add + Subtract - Multiply * Divide /]}->{$_}; say "$operand[0] $op $operand[1] = ", eval "$operand[0] $op $operand[1 +]"; __END__
It still tries to divide by 0 if given the (un)appropriate input.