Hello! Hope someone can help! I'm having a nightmare navigating an array of hashes. I'm using the Perl Twitter Module - . Running this script...
#!/usr/bin/perl
use Net::Twitter;
use Data:
umper;
print "Content-type: text/plain\n\n";
my $twit = Net::Twitter->new(username=>"username", password=>"password" );
$result = $twit->replies();
print Dumper($result);
I get:
$VAR1 = [
{
'source' => 'web',
'truncated' => bless( do{\(my $o = 0)}, 'JSON::XS::Boolean' ),
'created_at' => 'Thu Feb 21 02:27:32 +0000 2008',
'text' => 'Test Text',
'user' => {
'location' => undef,
'profile_image_url' => ' 'protected' => $VAR1->[0]{'truncated'},
'name' => 'myname',
'description' => undef,
'url' => undef,
'id' => 123456,
'screen_name' => 'myscreenname'
},
'id' => 123123123
},
{
'source' => 'web',
'truncated' => $VAR1->[0]{'truncated'},
'created_at' => 'Thu Feb 21 01:18:55 +0000 2008',
'text' => 'Test Text',
'user' => {
'location' => undef,
'profile_image_url' => ' 'protected' => $VAR1->[0]{'truncated'},
'name' => 'myname',
'description' => undef,
'url' => undef,
'id' => 123456,
'screen_name' => 'myscreenname'
},
'id' => 123123123
},
]
I have no idea how to parse this, I can't even pull any items out. Should by $result even be a scalar? Please please help!
Really appreciate it,
Stuart
#!/usr/bin/perl
use Net::Twitter;
use Data:
print "Content-type: text/plain\n\n";
my $twit = Net::Twitter->new(username=>"username", password=>"password" );
$result = $twit->replies();
print Dumper($result);
I get:
$VAR1 = [
{
'source' => 'web',
'truncated' => bless( do{\(my $o = 0)}, 'JSON::XS::Boolean' ),
'created_at' => 'Thu Feb 21 02:27:32 +0000 2008',
'text' => 'Test Text',
'user' => {
'location' => undef,
'profile_image_url' => ' 'protected' => $VAR1->[0]{'truncated'},
'name' => 'myname',
'description' => undef,
'url' => undef,
'id' => 123456,
'screen_name' => 'myscreenname'
},
'id' => 123123123
},
{
'source' => 'web',
'truncated' => $VAR1->[0]{'truncated'},
'created_at' => 'Thu Feb 21 01:18:55 +0000 2008',
'text' => 'Test Text',
'user' => {
'location' => undef,
'profile_image_url' => ' 'protected' => $VAR1->[0]{'truncated'},
'name' => 'myname',
'description' => undef,
'url' => undef,
'id' => 123456,
'screen_name' => 'myscreenname'
},
'id' => 123123123
},
]
I have no idea how to parse this, I can't even pull any items out. Should by $result even be a scalar? Please please help!
Really appreciate it,
Stuart