Help for this page

Select Code to Download


  1. or download this
    sub _private_sub {
       die "_private_sub is private!" unless caller eq __PACKAGE__;
       # private stuff #
    }
    
  2. or download this
    sub PROTECTED {
      my $self = shift;
    ...
      
      return $self;
    }
    
  3. or download this
    use base 'BaseClass';
    # some stuff #
    ...
       my $self = shift->PROTECTED;
       print "This is a protected sub!";
    }
    
  4. or download this
    method 'test2' is protected by 'LocalTest' at LocalTest.pm line 12
            LocalTest::test2('LocalTest2=HASH(0x18633a4)') called at test.
    +pl line 15
            main::test() called at test.pl line 20