I change the values for comparison from string to integers but I still receive the same error. "Syntax error.. might be a runaway multi-line"
Code:
print 'Welcome to the Calculator';
print 'Would you like to enter the calculator? Please Type y or n';
$run = <stdin>;
chomp $run;
while ($run == y)
{
{
print 'Add = 1 | Subtract = 2 | Multiply = 3 | Divide = 4 |Exponent = 5 | Mod = 6 ';
print 'Enter the corresponding number to the caluclation to be performed:';
$calc = <stdin>;
chomp $calc;
print 'Please enter the first value: ';
$A = <stdin>;
chomp $A;
print 'Please enter the second value: ';
$B = <stdin>;
chomp $B;
if($calc == 1)
{
$answer = $A + $B;
}
elsif($calc == 2)
{
$answer = $A - $B;
}
elsif($calc == 3)
{
$answer = $A * $B;
}
elsif($calc == 4)
{
$answer = $A / $B;
}
elsif($calc == 5)
{
$answer = $A ** $B;
}
elsif$4calc == 6)
{
$answer = $A % $B;
}
print "The answer is $answer .";
}
print 'Would you like to perform another calculation? Please Type y or n';
$run = <stdin>;
chomp = $run;
}
print 'The application is now terminated.';