Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use Reddit::Client to get my reddit messages

The method is get_inbox() and that works just fine, but it only gets page one of the inbox. Logically, knowing what I know about Reddit, I should be able to add an after param to the args, and indeed looking at the source that seems right:

sub get_inbox { my ($self, %param) = @_; my $limit = $param{limit} || DEFAULT_LIMIT; my $mode = $param{mode} || MESSAGES_INBOX; my $view = $param{view} || MESSAGES_INBOX; my $query = {}; $query->{mark} = $param{mark} ? 'true' : 'false'; $query->{sr_detail} = $param{sr_detail} if $param{sr_detail}; $query->{before} = $param{before} if $param{before}; $query->{after} = $param{after} if $param{after}; [... more code snipped ...] }

But when I add an 'after' param to my call to the sub, nothing changes:  $reddit->get_inbox( [ view => MESSAGES_MESSAGES, after => 'reddit_id_here' ] );

Also wait, why are the params being sent in an array ref, not a hash or hash ref? And why when I do this to the actual source code of the module:

sub get_inbox { my ($self, %param) = @_; my $limit = $param{limit} || DEFAULT_LIMIT; my $mode = $param{mode} || MESSAGES_INBOX; my $view = $param{view} || MESSAGES_INBOX; ### I ADDED THIS CODE TO DEBUG: print Dumper(\%param); exit();

Does Data::Dumper show me an array which isundef? Shouldn't everything from the args be in a hash? Instead I get

$VAR1 = { 'ARRAY(0x7ffbb4ba2768)' => undef };

I've had quite a few Christmas drinks over the last few days, but I'm obviously missing something here. The documentation is wrong? The subroutine is failing to get the args into %param? TIA for anyone who can help me out!