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


in reply to Re: improve ugly flow control
in thread improve ugly flow control

Neat hack. Note that the grep will always iterate all of @options though. Also, you can remove the dependency on do_something()'s return value with a construct like

exists $hash{ $_ } and ( do_something( $_ ), 1 )

Makeshifts last the longest.