in reply to The print is output later after die
STDOUT which print uses by default is buffered. die outputs to STDERR which is not buffered, therefore it shows immediately.
The buffering can be turned off:
#!/usr/bin/perl use warnings; use strict; # Uncomment to change the order: # *STDOUT->autoflush; print "abc"; die "ABC";
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: The print is output later after die
by hippo (Bishop) on Jan 28, 2022 at 10:52 UTC | |
Re^2: The print is output later after die
by syphilis (Archbishop) on Jan 28, 2022 at 11:51 UTC | |
by ikegami (Patriarch) on Jan 28, 2022 at 12:21 UTC | |
by Discipulus (Canon) on Jan 28, 2022 at 12:05 UTC | |
by choroba (Cardinal) on Jan 28, 2022 at 12:05 UTC | |
by ikegami (Patriarch) on Jan 28, 2022 at 12:23 UTC | |
Re^2: The print is output later after die
by eyepopslikeamosquito (Bishop) on Jan 29, 2022 at 02:21 UTC |
In Section
Seekers of Perl Wisdom