The %26gt;%26gt; opens the file for appending.
open(LOGFILE, "%26gt;%26gt; /tmp/log") or die "Can't write /tmp/log: $!";
The "hello world\n" will be appended.
print LOGFILE "hello world\n";
if you want to read from another file, just open it, read each line and write it:
open(FH, "input.txt");
while (%26lt;FH%26gt;) { print LOGFILE $_; }
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment