I'm writing a code that opens a file, reads its contents and puts every line (with modifications) in an array. Then I send this array to a new file. The only problem is that every line, except for the first line, in the new file has a single space at its beginning. I don't think I'm using my carriage return right. For example, if the old file read
Apples
Oranges
The new file would read
Apples
_Oranges
Where the "_" is not literally there but represents a single space (since I can't get the damn preview to look right)
.
open(WORDLIST, "file.txt");
while ($arrayword = <WORDLIST>) {
$arrayword = substr($arrayword, 0, 77)."\n";
I'm pretty sure this is the part of the code where the problem lies.
Any suggestions would help.
Thanks!!
Apples
Oranges
The new file would read
Apples
_Oranges
Where the "_" is not literally there but represents a single space (since I can't get the damn preview to look right)

Code:
open(WORDLIST, "file.txt");
while ($arrayword = <WORDLIST>) {
$arrayword = substr($arrayword, 0, 77)."\n";
I'm pretty sure this is the part of the code where the problem lies.
Any suggestions would help.
Thanks!!