Documentation: Net::Twitter

My goal is to have it return the lates status & screen name of the user searched for. I'm pretty confused by hash references, as when I use the dumper I just see this=>that=>this, but I can't figure out how to access all these things that I want.

But looking at the documentation for "lookup_users", it gives an array first, maybe since you can search multiple things, I think I figured out how to access that, but after that I'm not sure.

use warnings; use 5.010; use Net::Twitter; use Config::Tiny; use Data::Dumper qw(Dumper); use File::HomeDir; use Data::Dumper; my $nt = Net::Twitter->new( ssl => 1, traits => [qw/API::RESTv1_1/], consumer_key => '', consumer_secret => '', access_token => '', access_token_secret => '', ); my $l = $nt->lookup_users({ screen_name => 'twitter'}); my $tweet = (@{$l->{screen_name}}); print "$tweet\n";

Here I just tried to grab the screen name for a start, since the "status" is deeper. But this just gives me "Not a HASH reference"


In reply to Twitter API - Not a hash reference by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.