Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: perlbrew: Command [ ... ] terminated with exit code 0 ($? = 13)

by haukex (Archbishop)
on Mar 15, 2021 at 11:15 UTC ( #11129659=note: print w/replies, xml ) Need Help??


in reply to Re^2: perlbrew: Command [ ... ] terminated with exit code 0 ($? = 13)
in thread perlbrew: Command [ ... ] terminated with exit code 0 ($? = 13)

But if I try with slightly changed line:
perlbrew exec perl -wle 'print " A" x 1e0 for 1 .. 1e2' | less -S
There is no warning, although I didn't scroll the whole output.

perl -wle 'print " A" x 1e0 for 1 .. 1e2' is 300 bytes, while perl -wle 'print " A" x 1e3 for 1 .. 1e2' is 200100 bytes. Since you're piping the output of perl to another program, perl's output isn't line-based (see e.g. Suffering from Buffering), and so what I'm fairly certain is happening is that perl is simply outputting the 300 bytes in one go. Update: Because perl -wle '$|++; print " A" x 1e0 for 1 .. 1e2' isn't killed by SIGPIPE either, it may also have something to do with how much data a pipe can buffer, but I'm not an expert on that.

Replies are listed 'Best First'.
Re^4: perlbrew: Command [ ... ] terminated with exit code 0 ($? = 13)
by ikegami (Patriarch) on Mar 15, 2021 at 21:52 UTC

    I think Linux pipes can usually hold 128 KiB. This surely configurable.

    Update:

    $ perl -e' $|=1; $SIG{PIPE} = sub { die("SIGPIPE") }; print "x" x 1..15_328; ' | sleep 0.25 # Child needs to be alive when the print occurs. $ perl -e' $|=1; $SIG{PIPE} = sub { die("SIGPIPE") }; print "x" x 1..15_329; ' | sleep 0.25 SIGPIPE at -e line 3.

    It's 15,328 on my Ubuntu (over WSL2) system. What a weird number. That's 1,056 bytes less than 16 KiB (16,384).

    Seeking work! You can reach me at ikegami@adaelis.com

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-09-28 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?