Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Why can't I write to a custom log from a Catalyst application on SELinux/CentOS

by LanX (Saint)
on Feb 11, 2021 at 18:30 UTC ( [id://11128253]=note: print w/replies, xml ) Need Help??


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

> Not sure about the debugger, but code shows otherwise:

It's not the debugger, I think the system command (aka backticks) is causing a flush

#!/usr/bin/perl use strict; use warnings; use feature qw{ say }; unlink "./log.txt" or warn "$!"; open OUT, '>>', 'log.txt' or die $!; print OUT "before system\n"; print `type log.txt`; print OUT "after system\n"; open IN, '<', 'log.txt' or die $!; my $nothing = <IN>; say "Before close: $nothing.\n"; close OUT; my $bla = <IN>; say "After close: $bla.\n";

-*- mode: compilation; default-directory: "d:/tmp/pm/" -*- Compilation started at Thu Feb 11 19:29:04 C:/Perl_524/bin\perl.exe -w d:/tmp/pm/auto_flush.pl before system Before close: before system . After close: after system . Compilation finished at Thu Feb 11 19:29:05

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11128253]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-03-29 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found