I m 运行Windows XP, Eclipse 3.2 with EPIC and Cygwin for my Perl Interpretation,我得到意外结果。
FYI... 当我在乌本巴分配时( RV,同页)。 我获得了预期成果。 为什么?
############ CODE: #############
use warnings;
use strict;
my $test = "test";
my $input = <STDIN>;
print length $test, " ", length $input, "
";
chomp $input;
print "|$test| |$input|
"; #The bars indicate white space, new line, etc...
print length $test, " ", length $input, "
";
if ($test eq $input) {
print "TIME TO QUIT";
}
www.un.org/Depts/DGACM/index_spanish.htm Windows XP:
test <-- My input
4 6 <-- Lengths printed before chomp
|test| |test <-- Print the variables after chomp
| <-- There is still a new line there
4 5 <-- Lengths after the initial chomp