[問題] 可以請問一下嗎

看板Perl作者 (凡人)時間21年前 (2004/06/16 10:34), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/5 (看更多)
下面是一個程式...目的是把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) { $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"; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.129.62.125 ※ 編輯: ausir 來自: 140.129.62.125 (06/16 08:29)
文章代碼(AID): #10px6xP4 (Perl)
文章代碼(AID): #10px6xP4 (Perl)