我不是Perl程序員,所以我只需要這個簡單的腳本來運行:的Perl:無與倫比)在正則表達式錯誤
perl -e 'open(FILE,"tmp.plot"); my $seqLength = 643292; my $count=1; while(my $ln = <FILE>){ if($ln =~ m/^(\d+)\s+(\d+)/) { if($1 > $count) { for($i = $count; $i < $1
; $i++){ print "0\n" } }; print "$2\n"; $count=$1+1; } } for($i = $count; $i <= $seqLength; $i++){ print "0\n" }' > dnaplotter.plot
的錯誤是: Unmatched) in regex; marked by <-- HERE in m/^(\d+)\s+(\d+) <-- HERE/at -e line 1.
任何人都知道如何解決它?
預先感謝您!
TP
'-e'通常保留給單行。爲什麼不把它保存到一個腳本中並用'perl scriptname'運行它? – tadman 2013-05-02 23:14:52
我沒有收到錯誤,也沒有看到錯誤。 – kjprice 2013-05-02 23:15:15
在Perl 5.12.4上運行時,我不會收到錯誤。 – tadman 2013-05-02 23:17:10