文件内容:
bash-2.03$ cat file_4_ex_ch7.txt
anonymous attribute demolition grammar rules indices refernces lignA
Align,
ligning.
.
AABB
代码:
80 print "\n----------------------------------exercise_ch7_4--------------------------\n";
81 while(<>){
82 if(/[A-Z][a-z]+/){
83 print $_."\n" ;
84 }
85 if(/[a-z][A-Z]/){
86 print $_."\n" ;
87 }
88 }
89 print "\n----------------------------------exercise_ch7_4--------------------------\n";
输出:
----------------------------------exercise_ch7_4--------------------------
anonymous attribute demolition grammar rules indices refernces lignA
Align,
----------------------------------exercise_ch7_4--------------------------