#!/usr/bin/perl use strict; use warnings; use feature qw{ say }; unlink "./log.txt" or warn "$!"; # in case open OUT, '>>', 'log.txt' or die $!; { my $previous_default = select(OUT); # save previous default $|++; # autoflush OUT select($previous_default); # restore previous default } print OUT "before close"; open IN, '<', 'log.txt' or die $!; my $read; $read = <IN>; chomp $read; say "Before close: <$read>"; close OUT;
Before close: <before close>
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^5: Why can't I write to a custom log from a Catalyst application on SELinux/CentOS
by LanX
in thread Why can't I write to a custom log from a Catalyst application on SELinux/CentOS
by Cody Fendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |