Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Review of my scriptby tobyink (Canon) |
on May 16, 2013 at 09:31 UTC ( [id://1033797]=note: print w/replies, xml ) | Need Help?? |
When you type something like:
... 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
In Section
Seekers of Perl Wisdom
|
|