http://qs321.pair.com?node_id=11110776


in reply to Re^3: Super simple progress
in thread Super simple progress

Excellent thanks. I was just wondering is there any particular reason for using print '.'; STDOUT->flush; rather than print STDERR "."; ???

Replies are listed 'Best First'.
Re^5: Super simple progress
by davido (Cardinal) on Dec 30, 2019 at 18:45 UTC

    STDERR would be fine. And local $| = 1 would be fine in place of $handle->flush (where $handle is STDOUT or STDERR).

    One thing to keep in mind is if anyone is capturing output through redirection or piping. Things that are normal behavior, then, should go to STDOUT and things that need to be "out of band" go to STDERR. I don't know if the dots belong in-band or out-of-band from standard output. I could see a case being made for either behavior. I just picked one and went with it.


    Dave