Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by rsFalse (Chaplain)
on Mar 15, 2021 at 10:19 UTC ( #11129654=perlquestion: print w/replies, xml ) Need Help??

rsFalse has asked for the wisdom of the Perl Monks concerning the following question:

Hello,
I'm getting this strange error warning when printing bigger output of 'perlbrew exec perl' into pipe to 'less -S':

$ perlbrew exec perl -wle 'print " A" x 1e3 for 1 .. 1e2' | less -S Command [perl -wle 'print " A" x 1e3 for 1 .. 1e2'] terminated with ex +it code 0 ($? = 13) under the following perl environment:
Any ideas why it occurs?
P.S. I have two perls in perlbrew.

Replies are listed 'Best First'.
Re: perlbrew: Command [ ... ] terminated with exit code 0 ($? = 13)
by haukex (Archbishop) on Mar 15, 2021 at 10:28 UTC

    $? = 13 is (typically) a SIGPIPE. You probably exited less before scrolling through all the output.

      Ye. For sure. Thanks!
      If doesn't throw a warning if I scroll whole output.

      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.
        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2022-08-15 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?