sub FOO::DESTROY {print "DESTROYING FOO\n"} sub fn { my $fn = "FOO"; my $x = bless \$fn, "FOO"; return $x; } # In this case, for some reason $F above isn't destroyed until after # the for loop completes. for my $fn (fn()) { print "I got $fn\n"; }