我正在尝试在 Perl 等式中使用可能的变量。
例如:
#!/usr/bin/perl -w
$a = "yellow";
$b = "orange";
$c = "col1fl0ur";
$c = $a + $b;
print "$a + $b = $c \n";
我希望能够说明每个变量$a
, $b
,的值$c
,然后能够说
$a + $b = "col1fl0ur"
你可能会问;重点是什么?只需打印出来col1fl0ur
,但我也希望能够使用更多变量,例如在这种情况下:
#!/usr/bin/perl -w
###values###
$a = "yellow";
$b = "orange";
$c = "col1fl0ur";
$d = "derp";
$e = "oplo";
$f = "qwerty";
###defining the equation###
$c = $a + $b;
$d = $a + $c;
$f = $d + $c;
###Printing###
print "$a + $b = $c \n";
print "$a + $c = $d \n";
print "$d + $c = $f \n";