if ( my $var = something() ) { # use $var here }