i really just need some basic s/w engring architecting guidance... when i say 'architecting' -- i mean pseudo-code/stmts i can go after in the Perl book i have... and hopefully online examples...

i'm using Perl and i'm trying to parse Medline/Pubmed file paths on a Unix system in order to finally pass the PMID from each path to a pmid2doi conversion website < http://www.pmid2doi.org/ > ...

the structure of each link is of the form... /xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/UNC00000000000042/00223468/v45i3/S0022346809003820

--ls

18507872 main.pdf main.raw main.xml

where: 00223468 <-- this is the PMID

so far, in Perl, i've got something that looks like this...

#!/bin/perl use strict; use warnings; use LWP::Simple; # this is bash-like implementation of what i'm trying to do for doi in `find . -name "*.xml" | awk -F\/ '{print $2}' ` #this extr +acts the PMID do echo $doi wget http://www.pmid2doi.org/ done

the website < http://www.pmid2doi.org/ > requires inputting the PMID in order to get back the DOI...

this is what i need to get running in Perl... and i need a little help in architecting & implementing this...

given your development background, i'm grateful for any insights... or recommended sites for generating regular expressions in Perl...

thanks very much!

Additionally,

I see that http://www.pmid2doi.org/ says the REST API expects the http://www.pmid2doi.org/ PLUS the DOI value.

So I need to find some example Perl code that gets a REST value from a URL.

In REST I just prepare the URL as specified and then the returned result should be the value I want.


In reply to ... architecting & implementing help w/ Perl... by rickkar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.