... my $guard = My::Guard->new(sub { $sth->finish }); ... #### ... my $guard1 = My::Guard->new(sub { $sth->finish }); ... some code which needs the protection of guard1 ... my $guard2 = My::Guard->new(sub { .. clear up something else ..; $guard1; }); ... some code which needs the protection of both guards, and the order of resource clearing is important ...