HEX
Server: Apache
System: Linux iad1-shared-b8-33 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: samfetchero1 (10301780)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/doc/libwww-search-perl/examples/motif_references.pl
#!/usr/bin/perl

use strict;
use warnings;

use lib qw(../lib);
use WWW::Search;

my $motif	= shift || 'ACCTA';
my $s		= new WWW::Search ('PubMed');
$s->native_query( $motif );


my $count	= 0;
while (my $r = $s->next_result) {
	unless ($count++) {
		print "The following abstracts mention the motif '${motif}':\n\n";
	}
	
	print join(' ', "${count}.", $r->title, $r->description) . "\n\n";
}

unless ($count) {
	print "No abstracts were found that mention the motif '${motif}'.\n";
}