Content deleted Content added
m Add some wiki headers to the examples. |
m →Examples: Add in "use strict" and "use warnings" |
||
Line 26:
''hello_world.pl''
----
#!/usr/bin/perl
# Loads the module and imports any functions into our namespace
Line 44:
package Hello::World;
# By default Perl allows you to use variables without declaring
# them. While this may be convenient for short scripts and
# one-liners, in a longer module it is wise to declare your variables
# both to catch typos and to keep them from being accessible outside
# the module.
use strict;
# Similarly, Perl does not issue warnings by default. A module, being
# more complicated then a script, usually will find them very helpful
# for debugging.
use warnings;
# A module's version number is stored in $ModuleName::VERSION; certain
# forms of the "use" built-in depend on this variable being defined.
Line 123 ⟶ 138:
''hello_world.pl''
----
#!/usr/bin/perl
use Hello::World;
Line 141 ⟶ 156:
package Hello::World;
use strict;
use warnings;
our $VERSION = "1.00";
|