for ( $sFunction ) { /test1/ || /test2/ and do { # .... }; /test2/ and do { # will be executed too }; } #### my $do_test1 = sub { #... }; for ( $sFunction ) { /test1/ && $do_test1->(); /test2/ && do { $do_test1->(); # will be executed too }; }