Used Cars fl http://usedcars.com en-us Thu, 14 Jun 2012 13:00:00 -0400 Copyright 2012, West Palm Beach 120 <![CDATA[220 Used Cars]]> Wed, 16 May 2012 20:14:52 -0400 http://usedcars.com http://usedcars.com Description of used car. ******************************************************* Perl Code: use CGI qw/:standard/; use LWP::UserAgent; use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; use Data::Dumper; $page=new CGI; use CGI::Carp 'fatalsToBrowser'; print $page->header; $xml = new XML::Simple (KeyAttr=>[''],NSExpand => 0,ForceArray=> 1); # read XML file $html="data_records2.txt"; $data =$xml->XMLin($html); open(FILE1,">data_out.txt"); print FILE1 Dumper($data); #if ($@) { warn "Error: $@\n"; #} $config_string='{channel}{item}'; foreach $e(@{eval("\$data->$config_string")}) { $count++; print $e->{title} ,$e->{description}, $e->{link}."\n"; } close(FILE1); exit; ############################################ Heres the output . Never gets to print data in the foreach loop. $VAR1 = { 'version' => '2.0', 'channel' => [ { 'link' => [ 'http://usedcars.com' ], 'lastBuildDate' => [ 'Thu, 14 Jun 2012 13:00:00 -0400' ], 'language' => [ 'en-us' ], 'ttl' => [ '120' ], 'item' => [ { 'link' => [ 'http://usedcars.com' ], 'guid' => [ 'http://usedcars.com' ], 'title' => [ '220 Used Cars' ], 'description' => [ 'Description of used car.' ], 'pubDate' => [ 'Wed, 16 May 2012 20:14:52 -0400' ] } ], 'copyright' => [ 'Copyright 2012, West Palm Beach' ], 'title' => [ 'Used Cars fl' ] } ] }; ****************************************************** Thanks you Oh mighty perl Gods--- I mean Monks. This appears too ez. I hang my head low in light of the great ones.