Help for this page

Select Code to Download


  1. or download this
    my ($price, $floor) = &get_price_floor() || 0;
  2. or download this
    return (10, 8);
    
  3. or download this
    my ($price, $floor);  ## needs to be declared in a separate statement
    ($price, $floor) = &get_price_floor() or ($price, $floor) = (0, 0);
    
  4. or download this
    sub good { return (10, 8); }
    sub bad { return (); }
    ...
    print "good: price=$price, floor=$floor\n";
    ($price, $floor) = bad() or ($price, $floor) = (0, 0);
    print "bad: price=$price, floor=$floor\n";
    
  5. or download this
    good: price=10, floor=8
    bad: price=0, floor=0