[root@master perl]# cat 4.pl
$data = "this>";
#local $/ = ">";
chomp($data);
print "$data is $data
";
[root@master perl]# perl 4.pl
$data is this>
[root@master perl]# cat 4.pl
$data = "this>";
local $/ = ">";
chomp($data);
print "$data is $data
";
[root@master perl]# perl 4.pl
$data is this
默认值为“
". perl中”行“的概念就由$/决定。