#! /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;