I would probably do this as (or as nested if's as ikegami suggested):
{ my $x; if( $x = f() and g($x) ) { ... } }
If you really didn't like the extra block/indent, you could also do:
{ last unless( my $x = f() ); last unless( g($x) ); ... }
In reply to Re: scope of my $x in if statements
by ig
in thread scope of my $x in if statements
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |