数分前まで、私はPerlがあらゆる種類の$行末に一致すると信じていました。残念ながら、私の仮定は間違っていることが判明しました。
次のスクリプトは、単語endのみを削除し$string3ます。
use warnings;
use strict;
my $string1 = " match to the end" . chr(13);
my $string2 = " match to the end" . chr(13) . chr(10);
my $string3 = " match to the end" . chr(10);
$string1 =~ s/ end$//;
$string2 =~ s/ end$//;
$string3 =~ s/ end$//;
print "$string1\n";
print "$string2\n";
print "$string3\n";
しかし$、少なくともchr(13).chr(10).
では、アトムは正確には何に (そしてどのような状況で)$一致するのでしょうか?