Debian Codegraph @

pubmed/examples/motif_references.pl

raw
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use lib qw(../lib);
7 use WWW::Search;
8
9 my $motif = shift || 'ACCTA';
10 my $s = new WWW::Search ('PubMed');
11 $s->native_query( $motif );
12
13
14 my $count = 0;
15 while (my $r = $s->next_result) {
16 unless ($count++) {
17 print "The following abstracts mention the motif '${motif}':\n\n";
18 }
19
20 print join(' ', "${count}.", $r->title, $r->description) . "\n\n";
21 }
22
23 unless ($count) {
24 print "No abstracts were found that mention the motif '${motif}'.\n";
25 }
26