Help for this page

Select Code to Download


  1. or download this
    package Bar;
    
    ...
      $bar++;
      return $bar;
    }
    
  2. or download this
    $bar1 = Bar->new();
    $bar2 = Bar->new();
    ...
    $bar1->foo(); # returns 1, as you would expect
    $bar1->foo(); # returns 2, as you would expect
    $bar2->foo(); # returns 3, possibly unexpected