in reply to Data Structure: HOA or AOH ??
See hash slice -- essentially, the left-hand side @table{@cols} is a list of hash elements, the right hand side is a list of strings returned by splitting each input line at TAB characters.
$table{'col1'} is assigned the first string contained in each input line, $table{'col2'} is assinged the second string, and so on. If there are more than four strings, only the first four are used. If there are less than four strings, the remaining hash elements are assigned the undef value.
You could write the same code more verbosely as:
($table{'col1'},$table{'col2'},$table{'col3'},$table{'col4'})=split /\t/;Alexander
|
|---|