http://www.perlmonks.org?node_id=526105


in reply to Re^3: Flipin good, or a total flop?
in thread Flipin good, or a total flop?

bar() if my $foo;
is different from
my $foo if bar(); # don't do this!

The first case is equivalent to

if (my $foo) { # $foo is lexically scoped to this block bar(); }
just like how
for my $foo (@foo) { # $foo is lexically scoped to this block baz(); }

So if ((my $start =~ /start/) .. (my $end =~ /end/)) is perfectly happy.