sharanmath has asked for the wisdom of the Perl Monks concerning the following question:

Please let me know the difference between or and '||' operators with example.

Thanks in advance, Sharan

Replies are listed 'Best First'.
Re: difference between or and || operators
by FunkyMonk (Bishop) on Mar 02, 2010 at 11:10 UTC
    || has a higher precedence than or. See perlop.
Re: difference between or and || operators
by AnomalousMonk (Archbishop) on Mar 02, 2010 at 18:23 UTC

    The critical point regarding precedence has already been made. As for an example:

    >perl -wMstrict -le "print 0 || 1; print 0 or 1; print(0 or 1); " 1 0 1
Re: difference between or and || operators
by ungalnanban (Pilgrim) on Mar 02, 2010 at 12:45 UTC

    See the link
    http://www.perl.com/doc/manual/html/pod/perlop.html

    Note: The Previous link of this thread posted by sugumar
    --sugumar--
      The previous "link" was not a link either
Re: difference between or and || operators
by Anonymous Monk on Mar 02, 2010 at 11:24 UTC

    See the link
    http://www.cs.cmu.edu/afs/cs/user/rgs/mosaic/pl-exp-op.html