elsif中确实缺一个"e"
1 #!/usr/bin/perl -w
2 $a = <STDIN>;
3 chop $a;
4 if (!$a)
5 {
6 print "The string is empty!";
7 }
8 elsif (length($a) == 1)
9 {
10 print "The string has one character!/n";
11 }
12 elsif (length($a) == 2)
13 {
14 print "The string has two characters!/n";
15 }
16 else
17 {
18 print "the string has many characters!/n";
19 }
1 #!/usr/bin/perl -w
2 $a = <STDIN>;
3 chop $a;
4 if (!$a)
5 {
6 print "The string is empty!";
7 }
8 elsif (length($a) == 1)
9 {
10 print "The string has one character!/n";
11 }
12 elsif (length($a) == 2)
13 {
14 print "The string has two characters!/n";
15 }
16 else
17 {
18 print "the string has many characters!/n";
19 }