in reply to Sutra of Optimism

Wouldn't it make more sense to have an optimist be  /\d+/; and a pessimest /\d*/;?

Replies are listed 'Best First'.
Re^2: Sutra of Optimism
by diotalevi (Canon) on Nov 27, 2002 at 07:54 UTC

    No because /\d*/ will always match so you must be significantly more optimistic about the state of your data than a more restrictive /\d+/. requiring at least /something/ is still pretty optimistic...

    __SIG__ use B; printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;
Re: Re: Sutra of Optimism
by submersible_toaster (Chaplain) on Nov 28, 2002 at 06:44 UTC
    /\d*/ would be the apathist , I'll take digits if they're there, but whatever is fine by me..

    the optimist perhaps would not even consider using a regex, this scalar will always be a number.

    the pessimist ?

      the pessimist ?
      die "Pessimist";
      A true pessimist would not even bother to test for the numbers, because he *knows* in his heart that there will be none. ;-)
      You have moved into a dark place.
      It is pitch black. You are likely to be eaten by a grue.