Difference between revisions of "perl notes"
From thelinuxwiki
| Line 7: | Line 7: | ||
<source lang="python">our $color='purple';</source> | <source lang="python">our $color='purple';</source> | ||
| − | ===interpolation===double quotes get the value of a variable | + | ===interpolation=== |
| − | + | double quotes get the value of a variable | |
| − | + | <source lang="python"> | |
| − | + | my $amount = 20; | |
| − | + | print "$amount\n"; | |
| − | + | print '$amount\n'; | |
| + | </source> | ||
20 | 20 | ||
$amount\n | $amount\n | ||
| − | + | ||
<source lang="python"></source> | <source lang="python"></source> | ||
Revision as of 11:58, 10 May 2021
variables
local
my $color='green';
global
our $color='purple';
interpolation
double quotes get the value of a variable
my $amount = 20; print "$amount\n"; print '$amount\n';
20 $amount\n