use Data::Dumper; use XML::Simple; use WWW::Mechanize; my $login_url = "http://www.jstor.org/action/doXmlSearch?query=dc.title+%3D+%22test%22&version=1.1&operation=searchRetrieve&recordSchema=info%3Asrw%2Fschema%2F1%2Fdc-v1.1&maximumRecords=10&startRecord=1&a.discipline=&recordPacking=xml"; my $mech = new WWW::Mechanize; $mech->get($login_url); my $xml = $mech->content; open (OUT, "> jestor_1.xml") || \ &htmlDie ("Error: Could not open output file!\n"); my @contents = split '\n', $xml; my $line; foreach $line (@contents) { chomp($line); next if ( $line =~ /^\s*$/m ); print OUT "$line\n"; } close (OUT); my $xs = XML::Simple->new(ForceArray => 'srw_dc:dc'); my $ref = $xs->XMLin("jestor_1.xml"); my $records_data = $ref->{'records'}->{'record'}->{'recordData'}->{'srw_dc:dc'}; foreach my $rd ($records_data){ my ($title) = $rd->{'dc:title'}; print "\n " . $title; }