in reply to Im missing something small here? (dereferencing complex references)

It probably has nothing to do with your problem, but

my $rval = \@rval;

is likely to reuse the same lexical array every time, isn't it? (quick typing ensues as I test that out....)

$ perl -e'for(1..10){my @rv; my $ref=\@rv; print "$ref\n"}' ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c) ARRAY(0x810218c)

I think what you wanted was

my $rval=[@rval];

--
Mike