看板 Perl 關於我們 聯絡資訊
假設我讀入一個檔案 lee David wang steve lee eric wu hunry .. .. .. .. .. .. 是個兩行的檔案,一行是姓,一行是名。 想要結果 輸入:lee 會印出: David eric .. .. 就是所以是lee的印出來 以下是我初步的程式: open FILE, "c:aa.txt"; #print <FILE>;→這是測試是否有成功讀取檔案 chomp(my$a=<>); .. .. print""; close FILE; 中間我卡了快一個禮拜整個沒頭緒,駱駝書第14章有練習過,但還是不知道怎下手 (一直很想用find,但是perl似乎沒這指令.....) -- -- ▂▂ ▂▂▂ ▂▄▅▅▄▆█ _█◣ ◢ (●) ◣/\\ 丫 │◥  ̄◤ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.215.116
dryman:就...用hash啊 09/27 19:01
dark22:array_search 不錯用... 09/27 22:20
kornelius:就算有 find 也不對呀... XD 09/28 01:25