- or download this
use lib 'path/to/the/modules';
# The example module could be path/to/the/modules/NameOfTheProject/Som
+eModule.pm
- or download this
use strict;
package NameOfTheProject::SomeModule;
...
}
1;
- or download this
use NameOfTheProject::SomeModule;
print NameOfTheProject::SomeModule::some_function(); # prints 123
- or download this
use base 'Exporter';
our @EXPORT_OK = ('some_function');
- or download this
use NameOfTheProject::SomeModule ('some_function');
print some_function(); # prints 123
- or download this
# This is config.pl
mirror => 'http://www.nl.example.com/mirror',
path => '/var/www/example',
skip_files => [ 'png', 'gif', 'jpg' ],
- or download this
# This is script.pl
use strict;
...
chdir $config{path};
...
- or download this
use strict;
package Acme::Include;
...
}
1;
- or download this
# This is foo.pl
use strict;
...
include 'bar.pl';
print $lexical; # Should print: set in bar.pl
- or download this
# This is bar.pl
use strict;
...
# There is no "my" here, because that would create a *new* lexical
# variable, hiding the existing one.