Help for this page

Select Code to Download


  1. or download this
    my $foo = Foo->new qw(
                            Foo::Bar 
                            Foo::Baz
                          );
    
  2. or download this
        my @submodules = @_;
        for ( @submodules ) {
            eval "require $_" || die "$!";
        }
    
  3. or download this
    my $foo = Foo->new qw(
                            Bar 
                            Baz
                          );
    
  4. or download this
        for ( @submodules ) {
            eval "require Foo::$_" || die "$!";
        }
    
  5. or download this
    package Foo;
    sub new {
    ...
        bless { submodules => \@submodules }, $class;
    }
    1;
    
  6. or download this
    package Foo::Bar;
    sub details {
    ...
    }
    
    1;
    
  7. or download this
    #!/usr/bin/perl
    use Foo;
    ...
          . $/;
    }
    # prints: Simon is a doctor
    
  8. or download this
    package Foo;
    sub new {
    ...
        bless { submodules => \@submodules }, $class;
    }
    1;
    
  9. or download this
    package Foo::Bar;
    sub details {
    ...
    }
    
    1;
    
  10. or download this
    #!/usr/bin/perl
    use Foo;
    ...
    }
    # prints: Can't locate object method "details" via package "Bar" 
    # (perhaps you forgot to load "Bar"?)