perlで変数2

$ vim 110211.pl

a

my $name = "programming Lesson";
print "\$name is $name\n";

my $name = "Programming" . "Lesson";
print "\$name is $name\n";

my $name = "Programming ". "Lesson";
print "\$name is $name\n";

my $name1 = "Programming";
my $name2 = "Lesson";
my $name = "$name1 $name2";
print "\$name is $name\n";

Esc

:wq


$ perl -cw 110211.pl
110211.pl syntax OK

$ perl 110211.pl #作ったプログラム110211.plの実行

$name is programming Lesson
$name is ProgrammingLesson
$name is Programming Lesson
$name is Programming Lesson

$ vim 110211_2.pl

a


use strict;
use warnings;

my $x ="123";
my $y ="456";
print $x + $y

print $x . $y;

Esc

perl -cw 110211_2.pl
1110211_2.pl syntax OK

$ perl 110211_2.pl
579