[PerlChina] 答复: 请教一个读文件的问题

lixiang@net263.com xiang.li at net263.com
Sat Jul 15 07:50:51 PDT 2006


Icesword是个工具,可以查看很多系统信息,对于检查木马和间谍软件非常有效。

 

  _____  

发件人: china-pm-bounces+xiang.li=net263.com at pm.org
[mailto:china-pm-bounces+xiang.li=net263.com at pm.org] 代表 潘建锋
发送时间: 2006年7月15日 12:55
收件人: china-pm at pm.org
主题: Re: [PerlChina] 请教一个读文件的问题

 

虽然我最近打算学ICE――和你说的icesword好像没有什么关系,但应该不是你说的那
个潘建锋:-)

在06-7-15,king sir <kangxiong at gmail.com> 写道: 

潘建锋是icesword的潘建锋吗?

在06-7-14,islue <islue.hu at gmail.com> 写道: 

while () {
  next unless $_;
}
从你的描述看,加这么一行应该ok了

在06-7-14,潘建锋 <panjianfeng1979 at gmail.com > 写道: 

 <mailto:china-pm at pm.org> 

我现在有个文件类似 <mailto:china-pm at pm.org> 
struct C {
a=..;
b=..;
c=..;
d=..;
}

struct C { <mailto:china-pm at pm.org> 
a=..;

b=..; <mailto:china-pm at pm.org> 

c=..; <mailto:china-pm at pm.org> 

d=.. <mailto:china-pm at pm.org> 
}
...
我要读出每个结构的a和c值
我用了
my $condition=0;
while(<FILE>) {
 if (/a=(.+)/) {
  $arr[0] = $1;
  condition = 1;
 } elsif(condition == 1 && /c=(.+)/) {
  $arr[1] = $1
  condition = 0;
  # 往数据库插入@arr
 }
}
这样只能得到第一个struct的数据,然后提示
Use of uninitialized value in pattern match (m//) at ... 
 

 


_______________________________________________
China-pm mailing list
China-pm at pm.org
http://mail.pm.org/mailman/listinfo/china-pm


 


_______________________________________________
China-pm mailing list
China-pm at pm.org
http://mail.pm.org/mailman/listinfo/china-pm


 


_______________________________________________
China-pm mailing list
China-pm at pm.org
http://mail.pm.org/mailman/listinfo/china-pm

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20060715/4dc3512f/attachment.html 


More information about the China-pm mailing list