open (TARGET, ">$t"); open (FILE, "<$filename"); while () { chomp ($_); my ($ip,$ping,$hostname,$ports) = split /,/, $_; print TARGET "PRORAMM.exe -host $ip -function xxx\n"; };