#!/usr/bin/perl
$hello = "Hello World";
print "$hello\n"; # 記得加上換行符號
你也可以
#!/usr/bin/perl
use 5.010;
$hello = "Hello World";
say "$hello"; # say幫你省去換行符號
print "hello" . "world" # "helloworld"
print "Dean"x3 . "\n"; # DeanDeanDean
Symbols | String |
---|---|
== | eq |
!= | ne |
< | lt |
> | gt |
<= | le |
>= | ge |
$line = <STDIN>;
if ($line eq "\n"){
print "只是一個空列 !\n";
}
else {
print "該列所輸入的是: $line";
}