I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-07-26 21:18:03.809478-07 by opcraft
Contents not displaying
What am I doing wrong here? Here is my program:
#!/usr/bin/perl use XML::Simple; use LWP::Simple; $xml = new XML::Simple; my $web_source = get( "http://www.narberthusa.com/feeds/posts/default" ); $data = $xml->XMLin($web_source, forcearray => 1); foreach $a (@{$data->{entry}}) { print ++$c . "\n"; print "$a->{title}\n"; print $a->{author} . "\n"; print $a->{content} . "\n\n"; }
And here is what I get:
1 ARRAY(0x100a5e530) ARRAY(0x100a5c4d0) HASH(0x100a8ec80) 2 ARRAY(0x100a5c260) ARRAY(0x100a5b0a0) HASH(0x100a8c6d8) 3 ARRAY(0x100a5ae60) ARRAY(0x100a5acc8) HASH(0x100a8d2e8)
...and so forth. Why can I not access the true contents of these XML tags? Thanks for any hints!
Direct Responses: Write a response