zoukankan      html  css  js  c++  java
  • Perl语言入门:第七章习题:输出文件中包含一个大写字母的所有行,不输出一行的内容全是大写的

    文件内容:

    bash-2.03$ cat file_4_ex_ch7.txt
    anonymous attribute demolition grammar rules indices refernces lignA
    Align,

    ligning.
    .
    AABB

    代码:

         80 print " ----------------------------------exercise_ch7_4-------------------------- ";
         81 while(<>){
         82     if(/[A-Z][a-z]+/){
         83         print $_." " ;
         84     }
         85     if(/[a-z][A-Z]/){
         86         print $_." " ;
         87     }
         88 }
         89 print " ----------------------------------exercise_ch7_4-------------------------- ";

    输出:

    ----------------------------------exercise_ch7_4--------------------------
    anonymous attribute demolition grammar rules indices refernces lignA

    Align,


    ----------------------------------exercise_ch7_4--------------------------

  • 相关阅读:
    053-113
    053-262
    053-294
    053-494
    053-60
    053-105
    053-102
    053-218
    【转】LiveWriter插入高亮代码插件介绍 基于SyntaxHighighter
    windows live Writer test
  • 原文地址:https://www.cnblogs.com/books2read/p/11050122.html
Copyright © 2011-2022 走看看