Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Parsing a Hash

by GrandFather (Saint)
on Jul 22, 2009 at 01:02 UTC ( [id://782136]=note: print w/replies, xml ) Need Help??


in reply to Parsing a Hash

I see no such example code and the Data::Dumper output you show elsewhere is inconsistent with the loop. The dump shows a hash where the loop expects an array.

Furthermore your assertion that "I expected to see output, instead, I get nothing" is inconsistent with the combination of dump and the for loop syntax. The for loop is expecting an array reference and is getting a hash reference - is should complain "Not an ARRAY reference at ...".

The following probably gets the data you want (untried):

my $results = $nt->show_user($twitterID); my $id = $results->{id}; my $name = $results->{name}; print STDOUT $id." ".$name."<br>";

True laziness is hard work

Replies are listed 'Best First'.
Re^2: Parsing a Hash
by northwestdev (Acolyte) on Jul 22, 2009 at 04:31 UTC
    Look under Synopsis: http://search.cpan.org/~cthom/Net-Twitter-2.12/lib/Net/Twitter.pm You missed the post where I said: I get a blank page (except when I dump the hash, which I posted in another message on this thread, and that's the real dump of the hash, with no warnings).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://782136]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-24 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found