natxo has asked for the wisdom of the Perl Monks concerning the following question:
Where as if I add sleep 5; to the while loop, it prints the time to the screen, but nothing gets written to the file. I do not understand why. Any ideas? TIAuse strict; use warnings; my $log = "/tmp/log.txt"; open LOG, ">", $log or die "$!\n"; while ( 1 ) { my $time = localtime() ; print LOG "$time\n"; print "$time\n"; } close LOG;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem writing to a file handle
by ikegami (Patriarch) on Jun 19, 2010 at 19:48 UTC | |
|
Re: problem writing to a file handle
by Corion (Patriarch) on Jun 19, 2010 at 19:50 UTC | |
|
Re: problem writing to a file handle
by biohisham (Priest) on Jun 20, 2010 at 16:49 UTC |