在一個可執行文件。特等我有以下幾點:印刷比賽中文件的每一行的第一個實例(Perl的)
#!/usr/bin/env perl
$file = 'TfbG_peaks.txt';
open(INFO, $file) or die("Could not open file.");
foreach $line (<INFO>) {
if ($line =~ m/[^_]*(?=_)/){
#print $line; #this prints lines, which means there are matches
print $1; #but this prints nothing
}
}
基於我在http://goo.gl/YlEN7和http://goo.gl/VlwKe閱讀,print $1;
應打印在第一場比賽中每條線,但它不。幫幫我!
感謝您的快速,友好和翔實的迴應! – mmkstarr