while ($line=...) { my ($type,@tokens)=split(/\~/,$line); $statements{$type}->execute(@tokens[@{$columns{$type}}]); }