Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

short circuiting


use or / and to determine if a statement is to be exectued:

Two ways to use it:
use or :
$value > 10 || print "value is low" ;         # print right side if left is false
use and :
$value > 10 && print "value is high" ;        # print right side if left is true