Skip to content

Commit cdd3c1d

Browse files
committed
Add information about basic module structure and file extensions
1 parent d3ab2bf commit cdd3c1d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/Language/modules.pod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ to a type of package declared with the C<module> keyword (see example
1919
below) but here we mostly mean "module" as a set of source
2020
files in a namespace.
2121
22+
=head2 Basic Structure
23+
24+
Module distributions in Perl 6 have the same stucture as any distribution in
25+
the Perl family of languages: there is a main project directory containing
26+
a C<README> and C<LICENSE> file, a C<lib> directory for modules, a C<t>
27+
directory for tests, and possibly a C<bin> directory for executable programs
28+
and scripts.
29+
30+
Module files generally use the standard C<.pm> extension, and scripts or
31+
executables use C<.pl>. However, if you wish to highlight that the file is
32+
written in Perl 6 you can use the C<.pm6> extension for modules, and the
33+
C<.p6> extension for scripts. Test files still use the normal C<.t>
34+
extension.
35+
2236
=head2 Loading and Basic Importing
2337
2438
Loading a module makes the packages declared within available in the
@@ -286,3 +300,5 @@ C<use Vortex::TotalPerspective>, and your Perl 6 implementation will
286300
know where to look for the module file(s).
287301
288302
=end pod
303+
304+
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)