in reply to ref defines array element?

This is yet another case in the ongoing trial of perl's auto-vivification. What's happening there is that by creating a reference to the first element of @y you are forcing it into existence, however it will still be undefined as you have yet to assign anything to it e.g
use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1; my @y; print 'pre auto-vivify: ', Dumper(\@y); print 'reference to $y[0]: ', Dumper(\$y[0]); print 'post auto-vivify: ', Dumper(\@y); __output__ pre auto-vivify: [] reference to $y[0]: \undef post auto-vivify: [ undef ]
HTH

_________
broquaint