my $new_variable; if ($condition){ # initialize $new_variable here } # far down below, you can still use $new_variable.