sub do_fetch { # {{{1 my $self = shift; # get a reference to the object my $url = shift; # get the URL from the function call my $found = shift; # get the array reference which holds the result my $result = $self->callAPI($url, 'GET'); # do_fetch calls callAPI to do the HTTP request # Process if rc = 200 if ($result->is_success){ my $reply = decode_json($result->decoded_content); while (my ($i, $el) = each @{$$reply{'value'}}) { push @{$found}, $el; } # do a recursive call if @odata.nextlink is there if ($$reply{'@odata.nextLink'}){ do_fetch($self,$$reply{'@odata.nextLink'}, $found); } #print Dumper $$reply{'value'}; }else{ # Error handling print Dumper $result; die $result->status_line; } } # }}}