[첫화면으로]Perl/POD

마지막으로 [b]

Perl POD

Plain Old Documentation format

1. perlpod 정리
1.1. Ordinary Paragraph
1.2. Verbatim Paragraph
1.3. Command Paragraph
1.4. Formatting Codes
1.5. The Intent
1.6. Embedding Pods in Perl Modules
1.7. Hints for Writing Pod
1.8. 참고
2. perlpodstyle 정리
3. 한글
4. 기타
5. Comments

1. perlpod 정리

Perldoc:perlpod 요약

Pod 마크업을 이루는 세 가지 기본적인 단락 : ordinary, verbatim, command

1.1. Ordinary Paragraph

1.2. Verbatim Paragraph

1.3. Command Paragraph

    =pod
    =head1 Heading Text
    =head2 Heading Text
    =head3 Heading Text
    =head4 Heading Text
    =over indentlevel
    =item stuff
    =back
    =begin format
    =end format
    =for format text...
    =encoding type
    =cut

 =head1 Heading Text
 =head2 Heading Text
 =head3 Heading Text
 =head4 Heading Text

=head2 Object Attributes
=head2 Possible Values for C<$/>

 =over indentlevel
 =item stuff...
 =back

=item Using C<$|> to Control Buffering

 =cut

 =pod

=item stuff()

This function does stuff.

=cut

  sub stuff {
    ...
  }

=pod

Remember to check its return value, as in:

    stuff() || die "Couldn't do stuff!";

=cut

 =begin formatname
 =end formatname
 =for formatname text...

=begin html

<hr> <img src="thang.png">
<p> This is a raw HTML paragraph </p>

=end html

=for html <hr> <img src="thang.png">
<p> This is a raw HTML paragraph </p>

=begin html

<br>Figure 1.<br><IMG SRC="figure1.png"><br>

=end html

=begin text

---------------
|  foo        |
|        bar  |
---------------

^^^^ Figure 1. ^^^^

=end text

=for comment
Make sure that all the available options are documented!

 =encoding encodingname

=encoding utf8
=encoding koi8-r
=encoding ShiftJIS
=encoding big5

유의: 명령어가 있는 라인이 아니라 명령어가 포함된 단락의 끝날 때 그 명령어가 끝난다. 따라서 각 명령어는 단락을 끝내기 위해 바로 뒤에 빈 라인이 있어야 한다:

=over

=item *

First item

=item *

Second item

=back

=over

=item Foo()

Description of Foo function

=item Bar()

Description of Bar function

=back

1.4. Formatting Codes

포매팅 코드 안에 ">"가 들어가야 되는 경우, 여러 가지 방법이 있음
    C<< $a <=> $b >>
    C<<< $a <=> $b >>>
    C<<<<  $a <=> $b     >>>>
이것은 모두
    C<$a E<lt>=E<gt> $b>
와 같다

    C<<< open(X, ">>thing.dat") || die $! >>>
    C<< $foo->bar(); >>
위의 형태가 아래 형태보다 읽기 좋다
    C<open(X, "E<gt>E<gt>thing.dat") || die $!>
    C<$foo-E<gt>bar();>

1.5. The Intent

1.6. Embedding Pods in Perl Modules

__END__

=head1 NAME

Time::Local - efficiently compute time from local and GMT time

1.7. Hints for Writing Pod

1.8. 참고

2. perlpodstyle 정리

Perldoc:perlpodstyle 문서 정리

일반적인 얘기:

표준 섹션들:
    foo, bar - programs to do something

=head2 Normal Usage
=head2 Advanced Features
=head2 Writing Configuration Files

=item B<--section>=I<manext>
=item B<-s> I<manext>, B<--section>=I<manext>

=over 6
=item HOME
Used to determine the user's home directory. F<.foorc> in this
directory is read for configuration details, if it exists.
=back

    Copyright YEAR(s) YOUR NAME(s)
    This library is free software; you may redistribute it and/or modify
    it under the same terms as Perl itself.

그 외:

마크업을 과도하게 사용하지 말라.

3. 한글

윈도우 명령프롬프트에서 출력할 경우:

4. 기타

5. Comments

이름:  
Homepage:
내용:
 


컴퓨터분류
각주:
1. 그런데 perldoc 문서, 특히 모듈 문서는 SYNOPSIS 자리에 example 코드를 넣는 듯?

마지막 편집일: 2013-6-29 12:02 am (변경사항 [d])
2578 hits | Permalink | 변경내역 보기 [h] | 페이지 소스 보기