sub foo { print pop->[0], "\n" } my @objs = map bless([rand $_]), 1..10; $_->foo for @objs;