Difference between revisions of "perl notes"

From thelinuxwiki
Jump to: navigation, search
(Created page with "==variables== local <source lang="python">my $color='green';</source> global <source lang="python">our $color='purple';</source> <source lang="python"></source>")
 
Line 6: Line 6:
 
global
 
global
 
<source lang="python">our $color='purple';</source>
 
<source lang="python">our $color='purple';</source>
 +
 +
===interpolation===double quotes get the value of a variable
 +
<source lang="python">
 +
my $amount = 20;
 +
print "$amount\n";
 +
print '$amount\n';
 +
</source>
 +
20
 +
$amount\n
  
 
<source lang="python"></source>
 
<source lang="python"></source>

Revision as of 11:57, 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