Example 4-2. examples/intro/documentation.pl
#!/usr/bin/perl use strict; use warnings; print "Hello, there is no more code here\n"; =head1 Explaining how PODs work Documentation starts any time there is a =tag at the beginning of a line (tag can be any word) and ends where there is a =cut at the beginning of a line. Around the =tags you have to add empty rows. A =tag can be anything but there are some tags that actually have meaning: =head1 Main heading =head2 Subtitle =over 4 start of indentation =item * element =back end of indentation Documentation of PODs can be found in B<perldoc perlpod> See a few examples: =head1 Main heading text after main heading =head2 Less important title more text some text shown verbatim more verbatim text typed in indented to the right =over 4 =item * Issue =item * Other issue =back documentation ends here =cut print "Just documentation\n";
perl examples/intro/documentation.pl
perldoc examples/intro/documentation.pl
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Perl documentation | Up | Exercise: Hello world |