open(IN, "$file") || die "Cant open $file\nReason: $!\n"; while () { chomp(); my @row = split(/;/); if ( defined @row ) { $hash{$.} = \@row; } else { print "Empty line in $file at line: $.\n"; } }