in reply to Re: strange scope
in thread strange scope

It wouldn't be hard to imagine a situation where you want test the returns from a list of functions, attempted in sequence until one of them returns true, and then do some specific block of code depending on which one returned true. In other words, something like this could be called for:
my @params = ...; # whatever sets the context... if ( my $x = function_1( @params )) { # do something with the return value from function_1 } elsif ( $x = function_2( @params )) { # do something with the return value from function_2 } # ... and so on.
I don't know if this is the OP's situation, but it would motivate the kind of approach the OP is asking about. There might be other idioms for doing this sort of thing, but doing it this way seems reasonable.