my $x; if (f()) { ... $x = ...; } else { ... $x = ...; } #### my $found; for (...) { if (...) { $found = ... } } #### my @a; while (...) ... push @a, ...; }