$ perl -wE 'sub DESTROY {say "ping"} my $x = bless [];' ping $ perl -wE 'sub DESTROY {say "ping"} my $x = bless []; exec "echo"' $ #### Note that "exec" will not call your "END" blocks, nor will it invoke "DESTROY" methods on your objects.