小编Lea*_*lla的帖子

如何在运算符中转换perl变量for make equation?

my $numA= $ARGV[0]; #5
my $numB= $ARGV[1]; #5
my $func= $ARGV[2]; #+

my $result = $numA .$func . $numB; #The result shoudl be 10

print "The result is:  $result"; # The result is: 5+5
Run Code Online (Sandbox Code Playgroud)

我有这个代码,我希望'$ func'作为运算符添加'$ numA'和'$ numB'.

variables perl equation function operator-keyword

3
推荐指数
1
解决办法
108
查看次数

标签 统计

equation ×1

function ×1

operator-keyword ×1

perl ×1

variables ×1