in reply to Re^2: Review of my script
in thread Review of my script

When you type something like:

find-junk | xargs rm -f

... and find-junk bails out with an error message, you don't want the error message piped to rm -f, do you?

So a convention has arisen to provide usage instructions on STDERR if the program has been called incorrectly, but on STDOUT if the program has been called with an explicit --help.

fisher's suggested code does precisely this. It only selects STDERR if $err is a true value.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^4: Review of my script
by Anonymous Monk on May 16, 2013 at 10:06 UTC

    When you type something like

    That is a very specific case , I never do stuff like that (xargs + rm )