XML::Smart读取XML文件指定段

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#! /usr/bin/perl -w
use strict;
use XML::Smart;
use Data::Dumper;
my $file = $ARGV[0];
print $file."\n";
open(my $fh, ">", "cve-$file");
my $xml = XML::Smart->new($file);	
foreach my $entry (@{$xml->{nvd}->{entry}}) {
    print $fh $$entry{id}."\n";
}
close $fh;