in reply to Dereferencing arrays

Try this:

use Data::Dumper; print Dumper($nextimg);

and see if that helps to explain things a little.

update: My guess is

--MidLifeXis