perl学习笔记

一.正则表达式

匹配一个文件中的某个单词,并打印出来

 1 #!/usr/bin/perl
 2 
 3 use strict;
 4 use warnings;
 5 use v5.14;
 6 
 7 open(FILE, "< temp.pl");
 8 while(<FILE>){
 9     #print if /data/;
10     #next  if ~ /^#/;
11     print if (/is/ && /SINK/) ;
12 }
13 
14 close(FILE);
OPTIMISM, PASSION & HARDWORK
原文地址:https://www.cnblogs.com/hiramlee0534/p/5851370.html