in reply to Re: scope of my $x in if statementsin thread scope of my $x in if statements
Speaking of hideous, the functional approach written in Perl:
if (my $x = x(f(), \&g)) { ... } [download]
sub x { my ($x, $g) = @_; $x && $g->($x) } [download]