#!/usr/local/bin/perl -w use LWP::Simple; # Set base URL for all eutils my $utils = "http://www.ncbi.nlm.nih.gov/entrez/eutils"; # Setting up to search Pubmed for the term 'Cancer+Prostate' # and getting back a maximum of 10 records my $db ="Pubmed"; my $query ="Cancer+Prostate"; my $retmax = 10; #Build the URL to use esearch.fcgi my $esearch = "$utils/esearch.fcgi?" . "db=$db&retmax=$retmax&term="; # Use LWP to post URL and get the resulting webpage # which is saved in a variable my $esearch_result = get($esearch.$query); # print the variable and URL that was used print "ESEARCH RESULT: $esearch_result\n"; print "Using Query:\n$esearch$query\n";