Help for this page

Select Code to Download


  1. or download this
    use strict;
    use vars qw($foo);
    # ... code that uses $foo ...
    1;
    
  2. or download this
    use strict;
    use Library;
    # You can now use $foo freely.
    
  3. or download this
    use vars qw($foo);
    # Some code here.
    
    package Bar;
    # Now you can't use $foo, and won't accidentally access $main::foo.
    
  4. or download this
    package Foo;
    use strict;
    ...
    our @EXPORT_OK = qw(foo);
    # etc
    1;
    
  5. or download this
    package Foo;
    use strict;
    ...
    @EXPORT_OK = qw(foo);
    # etc
    1;
    
  6. or download this
    package Foo;
    use Exporter qw(import);
    ...
    use strict;
    # etc
    1;