Help for this page

Select Code to Download


  1. or download this
    package Test;
    
    ...
            my $value = shift;
            $self{theValue} = $value;
    }
    
  2. or download this
    use Test;
    
    ...
    $test1->setValue(2);
    print "test1 getValue after setValue(2) is " .$test1->getValue() ."\n"
    +;
    print "test getValue after test1->setValue(2) is ". $test->getValue() 
    +."\n";
    
  3. or download this
    test is Test=HASH(0x88fbc20)
    Use of uninitialized value in concatenation (.) or string at test.pl l
    +ine 9. #expected
    ...
    test1 getValue after new is 1 #wow, test1 "inherited" the value set by
    + the test object
    test1 getValue after setValue(2) is 2
    test getValue after test1->setValue(2) is 2 #and now test sees 2, inst
    +ead of 1