use lib 'C:/Perl64/www-connotea-perl-0.1/lib/'; my $fn0="extracted-connotea-pubmedID-2.1.txt"; open (IN0, $fn0) or die "Can't open $fn0: $!\n"; open (FH, ">:utf8",'bookmarks_only_for_PubmedID.txt'); use lib '../lib'; use WWW::Connotea; my $currentURI; my $PMID; my $c = WWW::Connotea->new( user => 'myusername', password => '........' ); $c->authenticate; ### dies if log-in credentials are incorrect while () { my $currentURI = $_; chomp($currentURI); my @tags = $c->posts_for(uri =>"$currentURI"); die "No candidate related articles\n" unless @tags; print FH "$currentURI\n"; foreach my $tag (@tags) { print FH "PMID: "; my $boo = $tag->bookmark(); my $foo = $boo->citation(); print FH $foo->identifiers(), "\n"; my $bar = grep(/PMID:^/, $foo->identifiers()); print FH $bar, "\n"; # if ($foo->identifiers() =~ m/(PMID:^)^.(\d+^)^/) # { # print FH "$2\n"; # } } } close IN0; close FH;