新的perl編碼器在這裏。問題Perl正則表達式
當我從網站複製並粘貼文本到文本文件並從該文件讀取時,我的perl腳本沒有問題。當我使用getstore從網站自動創建一個文件時,這是我想要的,輸出是一堆|的。
當我複製並粘貼或使用getstore下載文本時,文本看起來完全相同..我無法弄清楚問題所在。任何幫助將不勝感激。
,我的願望是如下的輸出:
|www\.arkinsoftware\.in|www\.askmeaboutrotary\.com|www\.assculturaleincontri\.it|www\.asu\.msmu\.ru|www\.atousoft\.com|www\.aucoeurdelanature\.
enter code here
這裏是我使用的代碼:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
getstore("http://www.malwaredomainlist.com/hostslist/hosts.txt", "malhosts.txt");
open(my $input, "<", "malhosts.txt");
while (my $line = <$input>) {
chomp $line;
$line =~ s/.*\s+//;
$line =~ s/\./\\\./g;
print "$line\|";
}