my $container = Container->new(qw(e1 e2 e3)); foreach ($container) { # now $_ is $container, NOT one of the elements in it }