source: trunk/third/perl/README.tw @ 18450

Revision 18450, 4.4 KB checked in by zacheiss, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18449, which included commits to RCS files with non-trunk default branches.
Line 
1If you read this file _as_is_, just ignore the funny characters you
2see. It is written in the POD format (see perlpod manpage) which is
3specially designed to be readable as is.
4
5The following documentation is written in Big5 encoding.
6
7¦pªG§A¥Î¤@¯ëªº¤å¦r½s¿è¾¹¾\Äý³o¥÷¤å¥ó, ½Ð©¿²¤¤å¤¤©_¯Sªºµù°O¦r²Å.
8³o¥÷¤å¥ó¬O¥H POD (²©ú¤å¥ó®æ¦¡) ¼g¦¨; ³oºØ®æ¦¡¬O¬°¤F¯àÅý¤Hª½±µÅª¨ú,
9¦Ó¯S§O³]­pªº. Ãö©ó¦¹®æ¦¡ªº¶i¤@¨B¸ê°T, ½Ð°Ñ¦Ò perlpod ½u¤W¤å¥ó.
10
11=head1 NAME
12
13perltw - ¥¿Å餤¤å Perl «ü«n
14
15=head1 DESCRIPTION
16
17Åwªï¨Ó¨ì Perl ªº¤Ñ¦a!
18
19±q 5.8.0 ª©¶}©l, Perl ¨ã³Æ¤F§¹µ½ªº Unicode (¸U°ê½X) ¤ä´©,
20¤]³s±a¤ä´©¤F³\¦h©Ô¤B»y¨t¥H¥~ªº½s½X¤è¦¡; CJK (¤¤¤éÁú) «K¬O¨ä¤¤ªº¤@³¡¥÷.
21Unicode ¬O°ê»Ú©Êªº¼Ð·Ç, ¸Õ¹Ï²[»\¥@¬É¤W©Ò¦³ªº¦r²Å: ¦è¤è¥@¬É, ªF¤è¥@¬É,
22¥H¤Î¨âªÌ¶¡ªº¤@¤Á (§Æþ¤å, ±Ô§Q¨È¤å, ªü©Ô§B¤å, §Æ§B¨Ó¤å, ¦L«×¤å,
23¦L¦a¦w¤å, µ¥µ¥). ¥¦¤]®e¯Ç¤F¦hºØ§@·~¨t²Î»P¥­»O (¦p PC ¤Î³Áª÷¶ð).
24
25Perl ¥»¨­¥H Unicode ¶i¦æ¾Þ§@. ³oªí¥Ü Perl ¤º³¡ªº¦r¦ê¸ê®Æ¥i¥Î Unicode
26ªí¥Ü; Perl ªº¨ç¦¡»Pºâ²Å (¨Ò¦p¥¿³Wªí¥Ü¦¡¤ñ¹ï) ¤]¯à¹ï Unicode ¶i¦æ¾Þ§@.
27¦b¿é¤J¤Î¿é¥X®É, ¬°¤F³B²z¥H Unicode ¤§«eªº½s½X¤è¦¡Àx¦sªº¸ê®Æ, Perl
28´£¨Ñ¤F Encode ³o­Ó¼Ò²Õ, ¥i¥HÅý§A»´©ö¦aŪ¨ú¤Î¼g¤J¦³ªº½s½X¸ê®Æ.
29
30Encode ©µ¦ù¼Ò²Õ¤ä´©¤U¦C¥¿Å餤¤åªº½s½X¤è¦¡ ('big5' ªí¥Ü 'big5-eten'):
31
32    big5-eten   Big5 ½s½X (§t­Ê¤Ñ©µ¦ù¦r§Î)
33    big5-hkscs  Big5 + ­»´ä¥~¦r¶°, 2001 ¦~ª©
34    cp950       ¦r½X­¶ 950 (Big5 + ·L³n²K¥[ªº¦r²Å)
35
36Á|¨Ò¨Ó»¡, ±N Big5 ½s½XªºÀÉ®×Âন Unicode, ¯­»ÝÁä¤J¤U¦C«ü¥O:
37
38    perl -Mencoding=big5,STDOUT,utf8 -pe1 < file.big5 > file.utf8
39
40Perl ¤]¤ºªþ¤F "piconv", ¤@¤ä§¹¥þ¥H Perl ¼g¦¨ªº¦r²ÅÂà´«¤u¨ãµ{¦¡, ¥Îªk¦p¤U:
41
42    piconv -f big5 -t utf8 < file.big5 > file.utf8
43    piconv -f utf8 -t big5 < file.utf8 > file.big5
44
45¥t¥~, §Q¥Î encoding ¼Ò²Õ, §A¥i¥H»´©ö¼g¥X¥H¦r²Å¬°³æ¦ìªºµ{¦¡½X, ¦p¤U©Ò¥Ü:
46
47    #!/usr/bin/env perl
48    # ±Ò°Ê big5 ¦r¦ê¸ÑªR; ¼Ð·Ç¿é¥X¤J¤Î¼Ð·Ç¿ù»~³£³]¬° big5 ½s½X
49    use encoding 'big5', STDIN => 'big5', STDOUT => 'big5';
50    print length("Àd¾m");            #  2 (Âù¤Þ¸¹ªí¥Ü¦r²Å)
51    print length('Àd¾m');            #  4 (³æ¤Þ¸¹ªí¥Ü¦ì¤¸²Õ)
52    print index("½Î½Î±Ð»£", "να"); # -1 (¤£¥]§t¦¹¤l¦r¦ê)
53    print index('½Î½Î±Ð»£', 'να'); #  1 (±q²Ä¤G­Ó¦ì¤¸²Õ¶}©l)
54
55¦b³Ì«á¤@¦C¨Ò¤l¸Ì, "½Î" ªº²Ä¤G­Ó¦ì¤¸²Õ»P "½Î" ªº²Ä¤@­Ó¦ì¤¸²Õµ²¦X¦¨ Big5
56½Xªº "ν"; "½Î" ªº²Ä¤G­Ó¦ì¤¸²Õ«h»P "±Ð" ªº²Ä¤@­Ó¦ì¤¸²Õµ²¦X¦¨ "α".
57³o¸Ñ¨M¤F¥H«e Big5 ½X¤ñ¹ï³B²z¤W±`¨£ªº°ÝÃD.
58
59=head2 ÃB¥~ªº¤¤¤å½s½X
60
61¦pªG»Ý­n§ó¦hªº¤¤¤å½s½X, ¥i¥H±q CPAN (L<http://www.cpan.org/>) ¤U¸ü
62Encode::HanExtra ¼Ò²Õ. ¥¦¥Ø«e´£¨Ñ¤U¦C½s½X¤è¦¡:
63
64    cccii       1980 ¦~¤å«Ø·|ªº¤¤¤å¸ê°T¥æ´«½X
65    euc-tw      Unix ©µ¦ù¦r²Å¶°, ¥]§t CNS11643 ¥­­± 1-7
66    big5plus    ¤¤¤å¼Æ¦ì¤Æ§Þ³N±À¼s°òª÷·|ªº Big5+
67    big5ext     ¤¤¤å¼Æ¦ì¤Æ§Þ³N±À¼s°òª÷·|ªº Big5e
68
69¥t¥~, Encode::HanConvert ¼Ò²Õ«h´£¨Ñ¤F²ÁcÂà´«¥Îªº¨âºØ½s½X:
70
71    big5-simp   Big5 ¥¿Å餤¤å»P Unicode ²Å餤¤å¤¬Âà
72    gbk-trad    GBK ²Å餤¤å»P Unicode ¥¿Å餤¤å¤¬Âà
73
74­Y·Q¦b GBK »P Big5 ¤§¶¡¤¬Âà, ½Ð°Ñ¦Ò¸Ó¼Ò²Õ¤ºªþªº b2g.pl »P g2b.pl ¨â¤äµ{¦¡,
75©Î¦bµ{¦¡¤º¨Ï¥Î¤U¦C¼gªk:
76
77    use Encode::HanConvert;
78    $euc_cn = big5_to_gb($big5); # ±q Big5 Âର GBK
79    $big5 = gb_to_big5($euc_cn); # ±q GBK Âର Big5
80
81=head2 ¶i¤@¨Bªº¸ê°T
82
83½Ð°Ñ¦Ò Perl ¤ºªþªº¤j¶q»¡©ú¤å¥ó (¤£©¯¥þ¬O¥Î­^¤å¼gªº), ¨Ó¾Ç²ß§ó¦hÃö©ó
84Perl ªºª¾ÃÑ, ¥H¤Î Unicode ªº¨Ï¥Î¤è¦¡. ¤£¹L, ¥~³¡ªº¸ê·½¬Û·íÂ×´I:
85
86=head2 ´£¨Ñ Perl ¸ê·½ªººô§}
87
88=over 4
89
90=item L<http://www.perl.com/>
91
92Perl ªº­º­¶ (¥Ñ¼ÚµÜ§¤½¥qºûÅ@)
93
94=item L<http://www.cpan.org/>
95
96Perl ºî¦X¨åÂúô (Comprehensive Perl Archive Network)
97
98=item L<http://lists.perl.org/>
99
100Perl ¶l»¼½×¾Â¤@Äý
101
102=back
103
104=head2 ¾Ç²ß Perl ªººô§}
105
106=over 4
107
108=item L<http://www.oreilly.com.tw/chinese/perl/index.html>
109
110¥¿Å餤¤åª©ªº¼ÚµÜ§ Perl ®ÑÂÇ
111
112=item L<http://groups.google.com/groups?q=tw.bbs.comp.lang.perl>
113
114»OÆW Perl ³s½u°Q½×°Ï (¤]´N¬O¦U¤j BBS ªº Perl ³s½uª©)
115
116=back
117
118=head2 Perl ¨Ï¥ÎªÌ¶°·|
119
120=over 4
121
122=item L<http://www.pm.org/groups/asia.shtml#Taiwan>
123
124»OÆW Perl ±À¼s²Õ¤@Äý
125
126=item L<http://irc.elixus.org/>
127
128ÃÀ¥ß¨ó½u¤W²á¤Ñ«Ç
129
130=back
131
132=head2 Unicode ¬ÛÃöºô§}
133
134=over 4
135
136=item L<http://www.unicode.org/>
137
138Unicode ¾Ç³N¾Ç·| (Unicode ¼Ð·Çªº¨î©wªÌ)
139
140=item L<http://www.cl.cam.ac.uk/%7Emgk25/unicode.html>
141
142Unix/Linux ¤Wªº UTF-8 ¤Î Unicode µª«È°Ý
143
144=back
145
146=head2 ¤¤¤å¤Æ¸ê°T
147
148=over 4
149
150=item ¬°¤°»ò¥s "¥¿Å餤¤å" ¤£¥s "ÁcÅ餤¤å"?
151
152L<http://www.csie.ntu.edu.tw/~b7506051/mozilla/faq.html#faqglossary>
153
154=item ¤¤¤å¤Æ³nÅéÁp·ù
155
156L<http://www.cpatch.org/>
157
158=item Linux ³nÅ餤¤å¤Æ­p¹º
159
160L<http://www.linux.org.tw/CLDP/>
161
162=back
163
164=head1 SEE ALSO
165
166L<Encode>, L<Encode::TW>, L<encoding>, L<perluniintro>, L<perlunicode>
167
168=head1 AUTHORS
169
170Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>
171
172Autrijus Tang (­ð©vº~) E<lt>autrijus@autrijus.orgE<gt>
173
174=cut
Note: See TracBrowser for help on using the repository browser.