[predb24:~/tests] $ cat lines.pl #!/usr/bin/perl open (TEST, ">test.txt"); print TEST "This is a test\n"; #print TEST "This is a test\n"; #print TEST "";<br/> close TEST;<br/> [predb24:~/tests] $ lines.pl [predb24:~/tests] $ od -cx test.txt 0000000 T h i s i s a t e s t \n \ +0 6854 7369 6920 2073 2061 6574 7473 000a 0000017 [predb24:~/tests] $ cat lines.pl #!/usr/bin/perl open (TEST, ">test.txt"); print TEST "This is a test\n"; print TEST "This is a test\n"; #print TEST ""; close TEST; [predb24:~/tests] $ lines.pl [predb24:~/tests] $ od -cx test.txt 0000000 T h i s i s a t e s t \n +T 6854 7369 6920 2073 2061 6574 7473 540a 0000020 h i s i s a t e s t \n 6968 2073 7369 6120 7420 7365 0a74 0000036 #!/usr/bin/perl open (TEST, ">test.txt"); print TEST "This is a test\n"; print TEST "This is a test\n"; print TEST ""; close TEST; [predb24:~/tests] $ lines.pl [predb24:~/tests] $ od -cx test.txt 0000000 T h i s i s a t e s t \n +T 6854 7369 6920 2073 2061 6574 7473 540a 0000020 h i s i s a t e s t \n 6968 2073 7369 6120 7420 7365 0a74 0000036 [predb24:~/tests] $ cat lines.pl #!/usr/bin/perl open (TEST, ">test.txt"); #print TEST "This is a test\n"; #print TEST "This is a test\n"; print TEST "\n"; close TEST; [predb24:~/tests] $ lines.pl [predb24:~/tests] $ od -cx test.txt 0000000 \n \0 000a 0000001
In reply to Why do I sometimes get null characters after the line feed when writing to files? by colint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |