You can try a data-driven approach:
my @matchers = ( qr/(Lz0|PLATO)/i, 'Apps', qr/(SKIDROW|POSTMORTEM|RELOADED|THETA|TiNYiSO|HI2U|TE|FLT|PROPHET| +Unleashed|OUTLAWS|ALiAS|JAGUAR)/i, 'Games', ... ); for (my $idx = 0; $i < @matchers; $i += 2) { if ($release_name =~ $matchers[$i]) } $category = $matchers[$i + 1]; print "[INFO] Category: $category"; last; # stop after the first category was found } } # code not tested
In reply to Re: if,if and again,if
by moritz
in thread if,if and again,if
by cesapun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |