#!/usr/bin/perl use strict; use warnings; sub f { print wantarray ? "LIST\n" : defined wantarray ? "SCALAR\n" : "VOID\n" } (f); my $foo = (f); my @foo = f; __END__ VOID SCALAR LIST