in reply to recursive call of current script
AFAIS you are not using next at the end of each block, so there is no explicit fall-through
so one way is
for ( $sFunction ) { /test1/ || /test2/ and do { # .... }; /test2/ and do { # will be executed too }; }
another way is to use a subroutine
my $do_test1 = sub { #... }; for ( $sFunction ) { /test1/ && $do_test1->(); /test2/ && do { $do_test1->(); # will be executed too }; }
On a side note: why don't you use if or even if-elsif-else constructs?
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: recursive call of current script
by feumw (Sexton) on Jun 21, 2022 at 11:51 UTC |