$VAR1 = [ { 'mentions' => [], 'author' => { 'avatar' => '035a793a88596c440cb0434f272d8f3c', 'discriminator' => '4559', 'id' => '159495601208164353', 'username' => 'MiyakoProductions' }, 'embeds' => [], 'channel_id' => '193239098226376705', 'tts' => bless( do{\(my $o = 0)}, 'JSON::XS::Boolean' ), 'mention_roles' => [], 'mention_everyone' => $VAR1->[0]{'tts'}, 'content' => 'so i wrote a simple script to pull each one automatically', 'id' => '233412710220562432', 'type' => 0, 'pinned' => $VAR1->[0]{'tts'}, 'edited_timestamp' => undef, 'timestamp' => '2016-10-06T02:18:46.715000+00:00', 'attachments' => [] } ]; Not a HASH reference at discord.pl line 70. #### sub getMessages($) { my $apiUrl = $baseUrl . "channels/" . $_[0] . "/messages?limit=1"; print "$apiUrl\n"; my $discordClient = WWW::Mechanize->new( agent => 'DiscordBot (LibDiscord-Perl5 1)' ); $discordClient->add_header('Authorization' => "$authToken"); my $clientConnected = eval { $discordClient->get($apiUrl, 'Content-Type' => 'application/json'); }; if (! $clientConnected ) { errorCon(); } else { # Set values when connection is successful our $apiContent = $discordClient->content; #print Dumper($apiContent) . "\n"; my @apiJson = decode_json( $apiContent ); print "Pretty Response:\n" . Dumper( @apiJson ) . "\n"; my $msgID = $apiJson[0]->{'id'}; my $msgAuthor = $apiJson[0]->{'author'}->{'username'}; my $msgContent = $apiJson[0]->{'content'}; if ($msgID > $lastMsgID) { print "<$msgAuthor> $msgContent\n"; $lastMsgID = $msgID; } } } sub errorCon { print "Error: Unable to connect to Discord!\n"; }