Help for this page

Select Code to Download


  1. or download this
    package Package1;
    use fields qw(attr1 attr2 attr3);
    ...
    }
    
    1;
    
  2. or download this
    use Package1;
    use Data::Dumper;
    ...
    $p->{attr1} = "set_1";
    print $p->{attr1}, "\n";
    $p->{attr4} = "set_4"; #this should fail, and did fail
    
  3. or download this
    use Package1;
    use Data::Dumper;
    ...
    print $p->[0]->{attr4};#the above two steps sunccessfully modified the
    + internal pseudo hash
    print Dumper($p);#again proves that I successfully modified the intern
    +al pseudo hash
    #print $p->{attr4};#this fails