in reply to scoping question

I agree with ikegami that the lack of symetry feels weird, even though its perfectly valid code.

Personally, I'd take the second approach but specificially limit the scope of $id (by use if the outer {}s).
{ ### Do this or that for $obj my $id; if ( $id = $obj->get_id() ) { $obj->do_this(); } elsif ( $id = $obj->create_id() ) { $obj->do_that(); } else { $obj->do_somethingelse(); }; }; { ### Do this and that for $next_obj my $id; if ( $id = $next_obj->get_id() ) { $next_obj->do_this(); } elsif ( $id = $next_obj->create_id() ) { $next_obj->do_that(); } else { $next_obj->do_somethingelse(); }; };