K
kvanka
Hi:
I am trying to append an existing file with some text and want to add a
"\n" in the end so that the next append will go on to a new line (I
need content to be on new line whenever appended).
But, seems perl is adding it to the same line no matter what I did...
Help greatly appreciated...
Here's code:
sub updateapplied()
{
open (THEFILE, ">>../files/info.csv") || Error_open ();
print THEFILE $studentf, "\n"; close(THEFILE);
}
I alternatively tried:
print THEFILE "$studentf\n";
print THEFILE "\n$studentf\n";
info.csv ends up like this (after 3 excecutions):
111111111111111111111
where $studentf == 1111111
I want it to store it as:
1111111
1111111
1111111
I hope I am clear with example....
I am trying to append an existing file with some text and want to add a
"\n" in the end so that the next append will go on to a new line (I
need content to be on new line whenever appended).
But, seems perl is adding it to the same line no matter what I did...
Help greatly appreciated...
Here's code:
sub updateapplied()
{
open (THEFILE, ">>../files/info.csv") || Error_open ();
print THEFILE $studentf, "\n"; close(THEFILE);
}
I alternatively tried:
print THEFILE "$studentf\n";
print THEFILE "\n$studentf\n";
info.csv ends up like this (after 3 excecutions):
111111111111111111111
where $studentf == 1111111
I want it to store it as:
1111111
1111111
1111111
I hope I am clear with example....