Help for this page

Select Code to Download


  1. or download this
    package foo;
    sub new{
    ...
        my $base = $self->{base_class};
        print eval "\$self->$base\::read";
    }
    
  2. or download this
    no strict 'refs';
    print $self->&{"$base\::read"};  # syntax error
    ...
    # executes but ignores $base's inheritance, if any
    no strict 'refs';
    print &{"$base\::read"}( $self );
    
  3. or download this
    # code above package foo unchanged
    
    ...
    }
    
    # all other code unchanged