A generalisation of wantarray
