嘿,我不知道爲什麼我的代碼不起作用。我試圖從包含的html文件中提取一些信息。如何提取到散列
Junk id="i_0100_1" alt="text1, text2 | text3"
Junk Junk id="i_0100_2" alt="text1, text2 | text3"
我正在使用它來做到這一點。
my $file = "page.html";
open (LOGFILE, $file);
my %hash;
while (my $line = <LOGFILE>)
{
%hash = $line =~ /^\s*id="([^"]*)"\s*alt="([^"]*)"/mg;
print $hash{'id'};
}
close LOGFILE;
我在想什麼?
不行.......... – nebulus 2011-01-07 16:36:18
它不起作用。不行。 – nebulus 2011-01-07 16:40:00
不起作用... – nebulus 2011-01-07 16:47:59