in reply to Re: strange scope
in thread strange scope
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.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.
|
|---|