Help for this page

Select Code to Download


  1. or download this
    my $value = shift() || 'default';
    
  2. or download this
    my $value = shift() or 'default';
    
  3. or download this
    my $value = shift() || 'default';
    
  4. or download this
    my $value = shift() or 'default';
    
  5. or download this
    #temp.pl
    $value = $x or $y or $z;
    $value = $x || $y || $z;
    $value = $x or $y || $z;
    $value = $x || $y or $z;
    
  6. or download this
    perl -MO=Deparse,-p  temp.pl
    
  7. or download this
    ((($value = $x) or $y) or $z);
    ($value = (($x || $y) || $z));
    (($value = $x) or ($y or $z));
    (($value = ($x || $y)) or $z);
    temp.pl syntax OK
    
  8. or download this
    $value = $x or $y or $z;
    
  9. or download this
    $value = $x or $y || $z;
    
  10. or download this
     
    $value = $x || $y or $z;