this would be my version of the #perl calculator

use strict;
use warnings;

sub enter_operation{
my @array ;
print("Perl calculator \n");
for (my $i = 0; $i < 1; $i++) {
print "Enter number 1: ";
chomp(my $num1 = );
print "Enter number 2: ";
chomp(my $num2 = );
print "Enter operator: ";
chomp(my $char = );
push @array, [$num1, $num2, $char];
}
return @array;
}

sub compute_operation {
my $val1 = shift;
my $val2 = shift;
my $ope1 = shift;
my $rsult = 0 ;
if ($ope1 eq '+') {
print "addition detected \n";
$rsult= $val1 + $val2;
} elsif ($ope1 eq '-') {
print "substraction detected \n";
$rsult= $val1 - $val2;
} elsif ($ope1 eq '*') {
print "multiplication detected \n";
$rsult= $val1 * $val2;
} elsif($ope1 eq '/') {
print "division detected \n";
$rsult= $val1 / $val2;
} else {
print "Invalid choice\n";
}
return $rsult;
}

my @my_array = &enter_operation();

foreach my $row (@my_array) {
my ($num1, $num2, $char) = @$row;
my $result = compute_operation($num1, $num2, $char);
print "$num1 $char $num2 = $result \n";
}