the unix command i ran is egrep -f temp_qc_file.txt temp_qc_running_file.txt > temp_file.txt My perl code is `egrep -f "$_proj_file" "$_running_file" > "$_admin_temp_file"`; I even printed the filenames ($_proj_file, $_running_file,$_admin_temp_file) and its correct.