in reply to Re^4: Why can't I write to a custom log from a Catalyst application on SELinux/CentOS
in thread Why can't I write to a custom log from a Catalyst application on SELinux/CentOS
#!/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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Why can't I write to a custom log from a Catalyst application on SELinux/CentOS
by LanX (Saint) on Feb 12, 2021 at 01:26 UTC |