perlquestion
rickkar
<p>
in running the code below i get
</p>
<p>
amc-~$ perl test3.pl
</p>
<p>
find: -type: -f: unknown type
</p>
<p>
need help in figuring out how to remedy
</p>
<p>
find: -type: -f: unknown type
</p>
<code>#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use LWP::Simple;
use File::Find; # for traversing directory and locating a particular file
use File::Copy;
use XML::Simple; # for parsing XML
use JSON::Parse; # for parsing JSON format
#use Data::Dumper qw(pp);
use Data::Dumper;
#use Data::Dump qw(pp);
my $filepath_root = '/Users/karcichr/Downloads/Elsevier/fulltext/elsevier/historical/' || shift @ARGV;
for( my @files = qx{find $filepath_root -name 'main.xml' -type -f} ) # step (1+2)
{
my $ref = XMLin( $_ ); # step (3)
{
die "Showing first main.xml xml: ", pp( $ref ); # dump $ref structure, so to learn where doi/title is
}
}
</code>