in reply to if,if and again,if
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: if,if and again,if
by Tanktalus (Canon) on Aug 23, 2012 at 17:57 UTC | |
by moritz (Cardinal) on Aug 23, 2012 at 18:04 UTC | |
|
Re^2: if,if and again,if
by cesapun (Acolyte) on Aug 21, 2012 at 10:54 UTC |