in reply to Re: A question about method return values and error checking
in thread A question about method return values and error checking

I've been thinking about it and I am leaning toward this. We had no idea that it might even return undef. What operating system has no name? And with the docs like they were, it's just not something we accounted for. But the logical defined or looks like the way to go.
  • Comment on Re^2: A question about method return values and error checking

Replies are listed 'Best First'.
Re^3: A question about method return values and error checking
by kennethk (Abbot) on Nov 05, 2015 at 01:51 UTC
    If you wanted to be particularly crazy, you could even go with:
    printf "Operating System: %s\n", $os->name( long => 1 ) // (`uname -o -r` =~ s/\n//r) || 'undefined';

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.