Help for this page

Select Code to Download


  1. or download this
    # this code is in Foo/Bar.pm
    package Foo::Bar;
    ...
    our @EXPORT = qw/baz/;
    sub baz { "Hello world"; }
    1;
    
  2. or download this
    use 5.010;
    use strict;
    use foo::bar;
    say Foo::Bar::baz(); # says "Hello world"
    
  3. or download this
    use 5.010;
    use strict;
    use Foo::Bar;
    say baz(); # says "Hello world"
    
  4. or download this
    use 5.010;
    use strict;
    use foo::bar;
    say baz(); # dies - undefined subroutine main::baz
    
  5. or download this
    use 5.010;
    use strict;
    use foo::bar;
    say foo::bar::baz(); # dies - undefined subroutine again