in reply to Perl bug ?

The first warning is generated in "some text 1 $errors->[0]" because $errors->[0] is undefined.

That expression also has the side effect of autovivifying $errors and that causes the $errors check on the test on the following line to succeed.