作者littleshan (我要加入剑道社!)
看板perl
标题Re: [问题] 可以请问一下吗
时间Wed Jun 16 03:13:34 2004
※ 引述《ausir (凡人)》之铭言:
: 下面是一个程式...目的是把ex1.txt的内容修改...
: 是将EC 3.4.11.2这个字串改成超连结...
: 可是小弟看不懂蓝色那里是什麽意思@@...
: 可以麻烦各位大大帮我看看吗....
: 感激不尽...
: #!/usr/bin/perl -w
: open(IN,"ex1.txt") || die "cannod open input file for reading";
: open(OUT,">>ex3.htm") || die "cannot open output file";
: print OUT "<html><body>";
: print OUT "<pre>";
: while(<IN>) {
: if ($_=~/(EC 3.4.11.2)/i) {
判断读入字串是否含有你说的那个字串
但我想这里是写错了
应该是这样才对
if ($_=~/(EC 3\.4\.11\.2)/i) {
: $EC_num=$1;
: $EC_num=~/EC\s(.+)/;
: $EC=$1;
: $insert="<a href=http://www.genome.ad.jp/dbget-bin/www_bfind_sub?dbkey=e
: nzyme&mode=bfind&max_hit=1000&keywords=$EC>"."protein enzyme"."</a>";
: $_=~s/$EC_num/$insert/i;
: }
: print OUT $_;
: }
: print OUT "</pre>";
: print OUT "</html></body>";
: close(OUT) || die "cannot close output file";
: close(IN) || die "cannot close input file: ex1.txt";
--
use BigInt
':constant';
eval{
local $SIG{ALRM}=
sub{
die "alarm\n"};
alarm 10;
foreach (
1..
2**
1024){}
alarm 0;
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.244.211
※ 编辑: littleshan 来自: 140.112.244.211 (06/16 03:13)