「Perl」if文で文字列の値を比較するサンプル
構文
if(boolean_expression){ //some code}
サンプルコード
#! /usr/bin/perl
use strict;
use warnings;
my $x = "abcd";
my $y = "abcd";
if ($x eq $y){
print "equal result";
}
実行結果
equal result
Coding Changes the World
構文
if(boolean_expression){ //some code}
サンプルコード
#! /usr/bin/perl
use strict;
use warnings;
my $x = "abcd";
my $y = "abcd";
if ($x eq $y){
print "equal result";
}
実行結果
equal result