in reply to Twitter API - Not a hash reference
Just seeing docs (never twitted inmy life..) I assume $nt->lookup_users.. returns an array so you need to iterate over element or access directly one as in:
# totally untested! my @users = $nt->lookup_users; foreach my $usr (@users){ print $usr{screen_name}; #?? use Data:Dump dd method to see the structure you get back (better t +han Data::Dumper) dd $usr } # or directly first element returned print $users[0]{screen_name}; dd $users[0];
UPDATE sorry the method does not returns an array but an array ref: not big difference but different..
# totally untested! again my $users = $nt->lookup_users; foreach my $usr (@$users){ print $usr{screen_name}; #?? use Data:Dump dd method to see the structure you get back (better t +han Data::Dumper) dd $usr } # or directly first element returned print $$users[0]->{screen_name}; dd $$users[0];
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Twitter API - Not a hash reference
by Anonymous Monk on Mar 08, 2018 at 20:38 UTC |