I am a complete newbie at Perl. I have just started getting from bash to Perl language. I am trying to do a simple perl scripting that takes three arguments: two integers and an operation (+, -, * or /) and outputs the computed value.
Example:
$ ./perl_calc.pl 12 -13 *
-156
$
However, I don`t know how to turn that operation variable (+, -, * or /) back to an operation only, since when I put in $ARGV[0] $ARGV[1] $ARGV[1] they are all treated either as string or int.
Pls help me.
Example:
$ ./perl_calc.pl 12 -13 *
-156
$
However, I don`t know how to turn that operation variable (+, -, * or /) back to an operation only, since when I put in $ARGV[0] $ARGV[1] $ARGV[1] they are all treated either as string or int.
Pls help me.
Comment