$ perl -E 'sub w { say wantarray ? "list" : "item" }; @a[0] = w(); $a[0] = w()' list item