Perl attention & technique

  1. 脚本位置信息

  2. perl -d: 打开调试功能
  3. windows下,html中指定路径:”file:\/\/\/path_to_the_file”;
  4. 对读入的数据进行split前,注意,要用chomp处理;
    因为,读入的数据的末尾的换行符会被分配到最后一串字符里。
    其实际影响案例有:1. 如果一个变量$var包含了换行符,我把这个变量放在system “gzip -d -c $var > filename”,这条命令$var后面的就无法生效,因为在$var已经敲了回车了。
  5. Installation:
  6. Your Perl is configured to link against libgdbm,but libgdbm.so was not found.:aptitude install libgdbm-dev
  7. Please tell me where I can find your apache src:
  8. Function Round: int($number+0.5)
  9. ‘Unquoted string “..” may clash with future reserved word
    I meet this warning because my filehandle is lowercase with the “warning” on. It’s better to use uppercase as developers wish.
  10. 重要的变量:
  11. 微型Perl: 修改文件内容

    -p:输出本行内容(-n: 不输出本行内容)
    -i:指定备份文件后缀名,如果给出-i选项并且没有指定后缀名,则覆盖原文件 (-i.bak)
    -e:需要运行的perl代码,分号分割,可写多条语句。计数变量可用。
    *.file: 需要修改的文件

  12. 已安装模块备份及重装
  13. 选择性正则匹配:/(.snp.gz|.snp.tar.gz|.snp)/,匹配上的模式保存在$1
  14. strict refs
  15. asdf

Leave a Reply

Your email address will not be published. Required fields are marked *