sub fill_table{ my ($datei,$src_path,$delimiter,$header,$type) = @_; open (IFILE, "< $src_path$datei") or die "can't open $src_path$datei: $!\n"; my $z = 0; while(my $BomLine = ){ $z++; my @Bom = (); if($type eq 'RegEx'){ @Bom = split(/$delimiter/, $BomLine); } else{ @Bom = split(/\Q$delimiter/, $BomLine); } for (0..(scalar(@Bom) -1)){ $arrayVar->{$z.','.($_ + 1)} = $Bom[$_]; } } close IFILE; }