Mercurial > hg > egg-tcls
comparison fetch_weather.pl @ 368:ed1c7f2d81df
fetch_weather: Close STDOUT filehandle before reopening it, to make sure we
are actually writing data to the intended output.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 18 Dec 2015 10:09:32 +0200 |
parents | 1ca8ae195077 |
children | 86adad909681 |
comparison
equal
deleted
inserted
replaced
367:1ca8ae195077 | 368:ed1c7f2d81df |
---|---|
502 ### | 502 ### |
503 ### Output | 503 ### Output |
504 ### | 504 ### |
505 if (opt_chk_valid("outfile", 1)) | 505 if (opt_chk_valid("outfile", 1)) |
506 { | 506 { |
507 close(STDOUT); | |
507 open(STDOUT, '>', opt_get("outfile")) or die("Could not open output file '".opt_get("outfile")."'.\n"); | 508 open(STDOUT, '>', opt_get("outfile")) or die("Could not open output file '".opt_get("outfile")."'.\n"); |
508 } | 509 } |
509 | 510 |
510 binmode STDOUT, ':encoding(utf-8)'; | 511 binmode STDOUT, ':encoding(utf-8)'; |
511 | 512 |