#!/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 extracts the PMID do echo $doi wget http://www.pmid2doi.org/ done