您的位置:首页 > 其它

perl next 循环

2015-12-04 09:20 246 查看
v-dev-redis01:/root# cat x.pl
open (LOG ,"<","/root/x.out");
while (<LOG>) {
chomp;
next if ($_ eq '192.168.32.5');
print "\$_ access $_\n";
}
v-dev-redis01:/root# cat x.out
192.168.32.1
192.168.32.2
192.168.32.3
192.168.32.4
192.168.32.5
192.168.32.6
192.168.32.7
v-dev-redis01:/root# perl x.pl
$_ access 192.168.32.1
$_ access 192.168.32.2
$_ access 192.168.32.3
$_ access 192.168.32.4
$_ access 192.168.32.6
$_ access 192.168.32.7
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: