open(FILEREAD, "< read.js") or die "Cannot open FILEREAD:$!"; open(FILEWRITE, "> write.js") or die "Cannot open FILEWRITE:$!"; while (){ $points = s//(points)+.,/; $levels = s//(levels)+.,/; print FILEWRITE "$points\n"; print FILEWRITE "$levels\n"; } close FILEWRITE; close FILEREAD;