Command-Run
view release on metacpan or search on metacpan
underlying Perl behavior.
This is fixed: the layer change is now undone before the handles are
restored, so the layer stack of the standard filehandles stays
exactly as the caller left it. With the fix, nofork is much faster
than fork in either mode, and most of the historical gap between
`:encoding` and raw mode (which was caused by the accumulation) is
gone:
# Benchmark: code ref with stdin (100-byte input,
# 1000 iterations, object reused)
fork: 495/s (baseline)
nofork + :encoding: 15,997/s (32x)
nofork + :utf8 (raw): 20,038/s (40x)
## Zero-Modification Callee Integration
A key advantage of this mechanism is that **callee modules typically
require no modification** to work with nofork+raw mode.
Many Perl modules use `use open` pragma or equivalent to set up
lib/Command/Run.pm view on Meta::CPAN
underlying Perl behavior.
This is fixed: the layer change is now undone before the handles are
restored, so the layer stack of the standard filehandles stays
exactly as the caller left it. With the fix, nofork is much faster
than fork in either mode, and most of the historical gap between
C<:encoding> and raw mode (which was caused by the accumulation) is
gone:
# Benchmark: code ref with stdin (100-byte input,
# 1000 iterations, object reused)
fork: 495/s (baseline)
nofork + :encoding: 15,997/s (32x)
nofork + :utf8 (raw): 20,038/s (40x)
=head2 Zero-Modification Callee Integration
A key advantage of this mechanism is that B<callee modules typically
require no modification> to work with nofork+raw mode.
Many Perl modules use C<use open> pragma or equivalent to set up
( run in 1.293 second using v1.01-cache-2.11-cpan-f03e8824b8d )