in reply to Re: Re: how do I sort on two fields in a hash table?
in thread how do I sort on two fields in a hash table?

Thanks for your response. I thought that || was the same as or. How are they different? Txs
  • Comment on Re: Re: Re: how do I sort on two fields in a hash table?

Replies are listed 'Best First'.
Re: Re: Re: Re: how do I sort on two fields in a hash table?
by larryl (Monk) on Mar 16, 2001 at 01:16 UTC

    They do the same thing, it's all about operator precedence. || has higher precedence than or, and other things in between. The perlop manpage has about everything you need to know. To steal an example from perlop, the following:
        unlink "alpha", "beta", "gamma" or gripe(), next LINE;
    works like:
        unlink("alpha", "beta", "gamma") or (gripe(), next LINE);
    but it would break using ||, because it would work like:
        unlink("alpha", "beta", ("gamma" || gripe()), next LINE;