看板 Perl 關於我們 聯絡資訊
之前使用grep都會搭配上RegEx 突然想到不知道可不可以拿來當成像unix之下的grep尋找相關字串行數出來? foreach $i (@test) { $line = grep($i, @test2); print $line; } @test 當中存了一群字串關鍵字 @test2 則是要找尋的標的 試跑了一下 發覺好像不行... 請問要怎麼修正才可以達到目的呢? 希望大大們可以指點一下 謝謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.193.34.151
dryman:grep出來的是array,你要用array來存 06/15 09:41
CindyLinz:行數用 List::MoreUtils 的 indexes 06/15 11:51