#the whole process of getting xml from site and giving it into the string variable #my $dioaddress = "http://dx.doi.org/10.1016/j.nuclphysa.2015.05.005"; # my $reqforxml = new HTTP::Request GET => $addressdio; # my $res = $userag->request($reqforxml); # my $content = $res->content; my $content = get("$addressdio"); # my $html = get("http://dx.doi.org/10.1007/s00601-015-1012-x") # or die "Couldn't fetch the Perl Cookbook's page."; # print "$html"; #opening the file to write string with xml open my $overwrite, '>', 'overwrite.xml' or die "error trying to overwrite: $!"; #writing string with xml to the file say $overwrite "$content"; #### ##