$chunklookup = "Datafile.txt"; open(DGRAB, $chunklookup) || die ("Could not open $chunklookup (DATA TO GRAB) \n"); while () {push(@datain, $_)};close DGRAB; foreach @datain {$currentline =$_; @linesplitfetch = split(/,/, $currentline); open (MYFILE6, '>@linesplitfetch[0].html')|| die ("Could not open @linesplitfetch[0].html \n"); print MYFILE6 "Durka Durka Durka $currentline here ";close(MYFILE6); } # foreach @datain