my ($type,@tokens)=split(/\~/,$line); if ($type eq "SendFiltered") { my ($tstamp,$cmnd_id,$alert_id,$send_id,$state,$svr_host) = @tokens[0-5]; my $sql = "INSERT ... } elsif ($type eq "AlertError") { ... }