note
ikegami
The point of the defined wasn't to prevent autovivification, but to implement the <c>grep</c> you had in your original code. The following two snippets are equivalent.
<c>
@b = map { defined($a[$_]) ? ($a[$_]) : () } 0..5;
</c>
<c>
@b = grep { defined } map { $a[$_] } 0..5;
</c>
<p>What you suggested (<c>@b = map { $a[$_] } 0..5;</c>) is *not* equivalent.
710067
710104