Assuming /Time_Stamp/i really means /^Time_Stamp\z/i,
my @array = ...; my %dispatch = ( time_stamp => sub { @time = split (/-/, $array[1]); $date_submited = $time[0]; $time_submited = $time[1]; }, ... ); my $func = $dispatch{lc($array[0])}; if ($func) { $func->(); } else { ... }
In reply to Re^3: Case Statement
by ikegami
in thread Case Statement
by phimtau123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |