Content deleted Content added
→Perl packages and namespaces: Clarified terminology in comments in examples; improved formatting |
→Procedural Example: Amplified comments in module definition |
||
Line 43:
----
<source lang="perl">
# "package"
# It dictates the name of the file if you want it to be "use"d.
# If more than one word, it constrains the ___location of the module.
package Hello::World;
Line 50 ⟶ 51:
# By default Perl allows you to use variables without declaring
# them.
#
# your variables both to catch typos and to
# accessibility appropriately from outside the module. The strict pragma
# forces you to declare your variables.
use strict;
# Similarly, Perl does not issue
#
# helpful for debugging. The warnings pragma turns on optional warnings.
use warnings;
Line 73 ⟶ 75:
use base 'Exporter';
#
#
our @EXPORT = qw(hello);
Line 95 ⟶ 97:
This is a procedural module which gives you the famous "Hello, world!"
message, and
=head2 Functions
|