兰花仙子来帮我看看在WINDOW下执行,SOLARIS下结果不对
时间:2010-07-28
来源:互联网
本帖最后由 nokia4321 于 2010-07-28 20:42 编辑
#! /usr/bin/perl
use warnings;
use strict;
my @line1;
open DH,"allog" or die "can not open
!\n";
while (my $line=<DH>
{
if($line=~/^\s*?AP/) {
$line=~s/\n//g;
}
push @line1,$line;
}
close (DH);
print @line1;
在WINDOW下的 显示 AP ....然后下一行显示在后边
solaris下显示的是 AP ... 不显示了,直接显示下一行.
为什么呢.
#! /usr/bin/perl
use warnings;
use strict;
my @line1;
open DH,"allog" or die "can not open

while (my $line=<DH>

if($line=~/^\s*?AP/) {
$line=~s/\n//g;
}
push @line1,$line;
}
close (DH);
print @line1;
在WINDOW下的 显示 AP ....然后下一行显示在后边
solaris下显示的是 AP ... 不显示了,直接显示下一行.
为什么呢.
作者: nokia4321 发布时间: 2010-07-28
版本是:
This is perl, v5.6.1 built for sun4-solaris-64int
(with 48 registered patches, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
This is perl, v5.6.1 built for sun4-solaris-64int
(with 48 registered patches, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
作者: nokia4321 发布时间: 2010-07-28
chomp
或者
s/[\n\r]{1,2}//g
或者
s/[\n\r]{1,2}//g
作者: ttcn_cu 发布时间: 2010-07-28
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28