in reply to Re: scope of my $x in if statements
in thread scope of my $x in if statements

Speaking of hideous, the functional approach written in Perl:

if (my $x = x(f(), \&g)) { ... }
having defined x() as
sub x { my ($x, $g) = @_; $x && $g->($x) }