By writing it this way: open(OUTPUTFILE, ">". $outputFile);
the script thinks that you are trying to open a file called >Out_input2.txt with the "greater than" sign actually being part of the file name. But what you want to do is open Out_input2.txt for writing, in which case the "greater than" sign, which means "open this file for writing," needs to be contained inside the quotes. open(OUTPUTFILE, ">$outputFile"); Scot R. inSite -----Original Message----- From: Daniel Gross [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 1:07 PM To: 'Scot Robnett' Subject: RE: Removing all \n in a text file. Hi Scot, Thanks for your help. I am not sure in what way this code differs from my previous one. Is the change in the open statement significant wrt to how \n are read and written. Thanks Dani -----Original Message----- From: Scot Robnett [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 1:42 PM To: Daniel Gross; [EMAIL PROTECTED] Subject: RE: Removing all \n in a text file. What if you made just this small change to your code? my $INPUTFILEHANDLE; my $OUTPUTFILEHANDLE; my $outputFile = "Out_input2.txt"; # If this is not in the # same directory as your # script, make sure that # you use the full path open (INPUTFILEHANDLE, "input.txt"); # When in doubt, full path # This is what you had: # open (OUTPUTFILEHANDLE, ">". $outputFile); # Instead, I think you want open (OUTPUTFILEHANDLE, ">$outputFile); # overwrites file # open (OUTPUTFILEHANDLE, ">>$outputFile); # would append instead while(<INPUTFILEHANDLE>) { chomp $_; # just added $_ to make it # explicit what we're chomping print OUTPUTFILEHANDLE $_; } close OUTPUTFILEHANDLE; close INPUTFILEHANDLE; # Scot R. # inSite -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]