version-0.77 >
0.74
との差分
version 0.74 と 0.77 の差分
1 | ||
2 | 1 | =encoding euc-jp |
3 | 2 | |
4 | 3 | =head1 NAME |
5 | 4 | |
6 | 5 | =begin original |
7 | 6 | |
8 | 7 | version - Perl extension for Version Objects |
9 | 8 | |
10 | 9 | =end original |
11 | 10 | |
12 | version - バージョンオブジェクトのための Perl | |
11 | version - バージョンオブジェクトのための Perl エクステンション | |
13 | 12 | |
14 | 13 | =head1 SYNOPSIS |
15 | 14 | |
16 | | |
15 | # Parsing version strings (decimal or dotted-decimal) | |
17 | $version = version->new("12.2.1"); # must be quoted for Perl < 5.8.1 | |
18 | print $version; # v12.2.1 | |
19 | print $version->numify; # 12.002001 | |
20 | if ( $version gt "12.2" ) # true | |
21 | 16 | |
22 | | |
17 | use version 0.77; # get latest bug-fixes and API | |
23 | | |
18 | $ver = version->parse($string) | |
24 | print $alphaver->is_alpha(); # true | |
25 | ||
26 | $ver = qv("1.2.0"); # v1.2.0 | |
27 | 19 | |
28 | | |
20 | # Declaring a dotted-decimal $VERSION (keep on one line!) | |
29 | print $perlver; # 5.005030 | |
30 | 21 | |
31 | ||
22 | use version 0.77; our $VERSION = version->declare("v1.2.3"); # formal | |
23 | use version 0.77; our $VERSION = qv("v1.2.3"); # shorthand | |
24 | use version 0.77; our $VERSION = qv("v1.2_3"); # alpha | |
32 | 25 | |
33 | ||
26 | # Declaring an old-style decimal $VERSION (use quotes!) | |
34 | 27 | |
35 | ||
28 | use version 0.77; our $VERSION = version->parse("1.0203"); # formal | |
36 | ||
29 | use version 0.77; our $VERSION = version->parse("1.02_03"); # alpha | |
37 | of Perl 5.10.0. | |
38 | 30 | |
39 | ||
31 | # Comparing mixed version styles (decimals, dotted-decimals, objects) | |
40 | 32 | |
41 | ||
33 | if ( version->parse($v1) == version->parse($v2) ) { | |
42 | ||
34 | # do stuff | |
43 | ||
35 | } | |
44 | 全機能を実装しています。 | |
45 | 36 | |
46 | ||
37 | # Sorting mixed version styles | |
47 | 38 | |
48 | = | |
39 | @ordered = sort { version->parse($a) <=> version->parse($b) } @list; | |
49 | 40 | |
50 | ||
41 | =head1 DESCRIPTION | |
51 | and/or for your $VERSION scalar to mean what you think it means, there | |
52 | are a few simple rules to follow: | |
53 | 42 | |
54 | =end original | |
55 | ||
56 | もしあなたのモジュールを違うバージョンの Perl で使えるようにしたければ、 | |
57 | あるいは $VERSION スカラーがあなたが意図する値を正しく取るようにしたければ、 | |
58 | 従うべき単純なルールがいくつかあります: | |
59 | ||
60 | =over 4 | |
61 | ||
62 | =item * Be consistent | |
63 | ||
64 | (一貫性を持って) | |
65 | ||
66 | 43 | =begin original |
67 | 44 | |
68 | ||
45 | Version objects were added to Perl in 5.10. This module implements version | |
69 | ||
46 | objects for older version of Perl and provides the version object API for all | |
70 | ||
47 | versions of Perl. All previous releases before 0.74 are deprecated and should | |
71 | ||
48 | not be used due to incompatible API changes. Version 0.77 introduces the new | |
49 | 'parse' and 'declare' methods to standardize usage. You are strongly urged to | |
50 | set 0.77 as a minimum in your code, e.g. | |
72 | 51 | |
73 | 52 | =end original |
74 | 53 | |
75 | ||
54 | バージョンオブジェクトは 5.10 で Perl に追加されました。 | |
76 | ||
55 | このモジュールは古いバージョンの Perl のためのバージョンオブジェクトを | |
77 | ||
56 | 実装し、全てのバージョンの Perl のためのバージョンオブジェクト API を | |
78 | ||
57 | 提供します。 | |
58 | 0.74 以前の全てのリリースは廃止予定で、互換性のない API の変更のため | |
59 | 使われるべきではありません。 | |
60 | バージョン 0.77 から使用法を標準化するために 'parse' と 'declare' が | |
61 | 導入されました。 | |
62 | コードに最低バージョンとして 0.77 を設定することを強く主張します; 例えば | |
79 | 63 | |
80 | ||
64 | use version 0.77; # even for Perl v.5.10.0 | |
81 | 65 | |
82 | ||
66 | =head1 TYPES OF VERSION OBJECTS | |
83 | to use the L<qv()> operator with a quoted term, e.g.: | |
84 | 67 | |
85 | ||
68 | (バージョンオブジェクトの種類) | |
86 | 69 | |
87 | もし L<Extended Versions> を使うのであれば、L<qv()> 演算子をクォート付きの | |
88 | 項を指定して使うことが強く推奨されます。 | |
89 | 例えば: | |
90 | ||
91 | use version; our $VERSION = qv("1.2.3"); | |
92 | ||
93 | 70 | =begin original |
94 | 71 | |
95 | ||
72 | There are two different types of version objects, corresponding to the two | |
73 | different styles of versions in use: | |
96 | 74 | |
97 | 75 | =end original |
98 | 76 | |
99 | ||
77 | バージョンの二つの異なった使用形式に対応して、二つの異なった | |
78 | バージョンオブジェクトの種類があります。 | |
100 | 79 | |
101 | = | |
80 | =over 2 | |
102 | 81 | |
103 | ||
82 | =item Decimal Versions | |
104 | your version objects you prefer and stick with it. It is also best to | |
105 | be explicit about what value you intend to assign your version object | |
106 | and to not rely on hidden behavior of the parser. | |
107 | 83 | |
108 | ||
84 | (10 進数バージョン) | |
109 | 85 | |
110 | 最低でも、バージョンオブジェクトを初期化する様々な方法のうち何を | |
111 | 使いたいかを決めて、その方法にこだわってください。 | |
112 | さらに、バージョンオブジェクトに割り当てようとしている値は何なのかに | |
113 | ついて明確に理解していることと、パーサの隠された動作を頼りにしないことが | |
114 | 最重要です。 | |
115 | ||
116 | =item * Be careful | |
117 | ||
118 | (慎重に) | |
119 | ||
120 | 86 | =begin original |
121 | 87 | |
122 | ||
88 | The classic floating-point number $VERSION. The advantage to this style is | |
123 | ||
89 | that you don't need to do anything special, just type a number (without | |
124 | ||
90 | quotes) into your source file. | |
125 | version objects with Module::Build, you should add an explicit dependency | |
126 | to the release of version.pm in your Build.PL: | |
127 | 91 | |
128 | 92 | =end original |
129 | 93 | |
130 | ||
94 | クラシックな浮動小数点数 $VERSION。 | |
131 | ||
95 | この形式の利点は何も特殊なことをする必要はなく、単にソースファイルに | |
132 | ||
96 | 番号を(クォートなしで)書くだけです。 | |
133 | 気付くでしょう。 | |
134 | もし Module::Build と同時にバージョンオブジェクトを使うのであれば、 | |
135 | version.pm の当該バージョンへの依存関係を Build.PL に明示的に | |
136 | 追加しなければなりません: | |
137 | 97 | |
138 | ||
98 | =item Dotted Decimal Versions | |
139 | ... | |
140 | requires => { | |
141 | ... , | |
142 | 'version' => 0.50, | |
143 | ..., | |
144 | }, | |
145 | ... | |
146 | ); | |
147 | 99 | |
148 | ||
100 | (ドット付き 10 進数バージョン) | |
149 | 101 | |
150 | and it should Just Work(TM). Module::Build will [hopefully soon] | |
151 | include full support for version objects; there are no current plans | |
152 | to patch ExtUtils::MakeMaker to support version objects. | |
153 | ||
154 | =end original | |
155 | ||
156 | これで動くはずです。 | |
157 | Module::Build は (きっとすぐに) バージョンオブジェクトを完全に | |
158 | サポートするでしょう; | |
159 | バージョンオブジェクトをサポートするために ExtUtils::MakeMaker にパッチを | |
160 | 当てる計画は今のところ存在しません。 | |
161 | ||
162 | =back | |
163 | ||
164 | =head2 Using modules that use version.pm | |
165 | ||
166 | (version.pm を使うモジュールの使い方) | |
167 | ||
168 | 102 | =begin original |
169 | 103 | |
170 | ||
104 | The more modern form of version assignment, with 3 (or potentially more) | |
171 | ||
105 | integers seperated by decimal points (e.g. v1.2.3). This is the form that | |
172 | ||
106 | Perl itself has used since 5.6.0 was released. The leading "v" is now | |
173 | ||
107 | strongly recommended for clarity, and will throw a warning in a future | |
174 | ||
108 | release if omitted. | |
175 | 109 | |
176 | 110 | =end original |
177 | 111 | |
178 | ||
112 | バージョン割り当てのより近代的な形式で、3 (または潜在的にはそれ以上) の | |
179 | た | |
113 | 整数を小数点で区切ったものです (例えば v1.2.3)。 | |
180 | ||
114 | これは Perl 自身が 5.6.0 がリリースされてから使っている形式です。 | |
181 | ||
115 | 先頭の "v" は現在では明確化のために強く推奨されていて、これがないと | |
182 | ||
116 | 将来のリリースでは警告を投げます。 | |
183 | 117 | |
184 | package Example; | |
185 | use version; $VERSION = qv('1.2.2'); | |
186 | ...module code here... | |
187 | 1; | |
188 | ||
189 | =over 4 | |
190 | ||
191 | =item Numeric versions always work | |
192 | ||
193 | (数値バージョンは常に動作する) | |
194 | ||
195 | =begin original | |
196 | ||
197 | Code of the form: | |
198 | ||
199 | =end original | |
200 | ||
201 | 以下の形式のコード: | |
202 | ||
203 | use Example 1.002003; | |
204 | ||
205 | =begin original | |
206 | ||
207 | will always work correctly. The C<use> will perform an automatic | |
208 | C<$VERSION> comparison using the floating point number given as the first | |
209 | term after the module name (e.g. above 1.002.003). In this case, the | |
210 | installed module is too old for the requested line, so you would see an | |
211 | error like: | |
212 | ||
213 | =end original | |
214 | ||
215 | は常に正しく動作します。 | |
216 | C<use> はモジュール名の次の項として与えられる | |
217 | 浮動小数点 (例:上述の 1.002.003) を使って自動的に C<$VERSION> の比較を | |
218 | 行います。 | |
219 | この例では、インストールされているモジュールは要求されたコードに | |
220 | 対して古すぎるので、次のようなエラーが表示されるでしょう: | |
221 | ||
222 | Example version 1.002003 (v1.2.3) required--this is only version 1.002002 (v1.2.2)... | |
223 | ||
224 | =item Extended version work sometimes | |
225 | ||
226 | (拡張バージョンは時々動作する) | |
227 | ||
228 | =begin original | |
229 | ||
230 | With Perl >= 5.6.2, you can also use a line like this: | |
231 | ||
232 | =end original | |
233 | ||
234 | Perl >= 5.6.2 では、次のようなコードを使うこともできます: | |
235 | ||
236 | use Example 1.2.3; | |
237 | ||
238 | =begin original | |
239 | ||
240 | and it will again work (i.e. give the error message as above), even with | |
241 | releases of Perl which do not normally support v-strings (see L<What about | |
242 | v-strings> below). This has to do with that fact that C<use> only checks | |
243 | to see if the second term I<looks like a number> and passes that to the | |
244 | replacement L<UNIVERSAL::VERSION>. This is not true in Perl 5.005_04, | |
245 | however, so you are B<strongly encouraged> to always use a numeric version | |
246 | in your code, even for those versions of Perl which support the extended | |
247 | version. | |
248 | ||
249 | =end original | |
250 | ||
251 | そしてこれも、たとえ通常は v-文字列 (下記の L<What about v-strings> を参照) を | |
252 | サポートしていないバージョンの Perl であっても、正常に動作するでしょう | |
253 | (すなわち、上述のエラーメッセージが表示されます)。 | |
254 | この場合、C<use> は 2 番目の項が I<数字のように見える> かどうかをチェックし、 | |
255 | それを Replacement L<UNIVERSAL::VERSION>に渡すだけだという事実が | |
256 | 関わってきます。 | |
257 | しかし、このことは Perl 5.005_04 では正しくなく、そのために | |
258 | extended version をサポートする Perl のバージョンにおいてさえも、コード中では | |
259 | 常に数値バージョンを使うことが B<強く推奨> されます。 | |
260 | ||
261 | 118 | =back |
262 | 119 | |
263 | =head2 What IS a version | |
264 | ||
265 | (で、バージョンって何?) | |
266 | ||
267 | 120 | =begin original |
268 | 121 | |
269 | ||
122 | See L<VERSION OBJECT DETAILS> for further information. | |
270 | positive integer values separated by one or more decimal points and | |
271 | optionally a single underscore. This corresponds to what Perl itself | |
272 | uses for a version, as well as extending the "version as number" that | |
273 | is discussed in the various editions of the Camel book. | |
274 | 123 | |
275 | 124 | =end original |
276 | 125 | |
277 | ||
126 | さらなる情報については L<VERSION OBJECT DETAILS> を参照してください。 | |
278 | 省略可能な | |
279 | 一つのアンダースコアによって区切られる正の整数値とします。 | |
280 | これは Perl 自身がバージョンを表すのに使用するものに対応し、また | |
281 | ラクダ本の各版で論じられた「数字としてのバージョン」を拡張します。 | |
282 | 127 | |
283 | = | |
128 | =head1 DECLARING VERSIONS | |
284 | 129 | |
285 | ||
130 | (バージョンの宣言) | |
286 | 131 | |
287 | =end original | |
288 | ||
289 | 実際にはバージョンオブジェクトには 2 種類あります。 | |
290 | ||
291 | =over 4 | |
292 | ||
293 | =item * Numeric Versions | |
294 | ||
295 | (数値バージョン) | |
296 | ||
297 | 132 | =begin original |
298 | 133 | |
299 | ||
134 | If you have a module that uses a decimal $VERSION (floating point), and you | |
300 | ||
135 | do not intend to ever change that, this module is not for you. There is | |
301 | ||
136 | nothing that version.pm gains you over a simple $VERSION assignment: | |
302 | these must be quoted to preserve the underscore formatting. | |
303 | 137 | |
304 | 138 | =end original |
305 | 139 | |
306 | ||
140 | 10 進数 $VERSION (浮動小数点数) を使うモジュールがあって、変更するつもりが | |
307 | こ | |
141 | ないなら、このモジュールはあなたのためのものではありません。 | |
308 | ||
142 | 単純な $VERSION 代入に対して version.pm から得られる利点はありません: | |
309 | 保持するにはクォートされなければなりません。 | |
310 | 143 | |
311 | ||
144 | our $VERSION = 1.02; | |
312 | 145 | |
313 | (拡張バージョン) | |
314 | ||
315 | 146 | =begin original |
316 | 147 | |
317 | ||
148 | Since Perl v5.10.0 includes the version.pm comparison logic anyways, | |
318 | ||
149 | you don't need to do anything at all. | |
319 | is what is commonly used in most open source software as the "external" | |
320 | version (the one used as part of the tag or tarfile name). The use | |
321 | of the exported L<qv()> function also produces this kind of version | |
322 | object. | |
323 | 150 | |
324 | 151 | =end original |
325 | 152 | |
326 | ||
153 | Perl v5.10.0 からはどちらにしろ version.pm 比較ロジックを含んでいるので、 | |
327 | ||
154 | 全く何もする必要はありません。 | |
328 | これはほとんどのオープンソースソフトウェアで「外部用」バージョン | |
329 | (タグや tar ファイル名の一部分として使われるもの) として一般的に | |
330 | 使われているものです。 | |
331 | エクスポートされた L<qv()> 関数を使用すると、この種のバージョン | |
332 | オブジェクトが生成されます。 | |
333 | 155 | |
334 | = | |
156 | =head2 How to convert a module from decimal to dotted-decimal | |
335 | 157 | |
336 | ||
158 | (10 進数からドット付き 10 進数へのモジュールの変換方法) | |
337 | 159 | |
338 | Both of these methods will produce similar version objects, in that | |
339 | the default stringification will yield the version L<Normal Form> only | |
340 | if required: | |
341 | ||
342 | =end original | |
343 | ||
344 | これらのメソッド両方が同様のバージョンオブジェクトを生成します; | |
345 | なぜなら、必要なときにのみデフォルトの文字列化はバージョンの | |
346 | L<Normal Form> を生み出すからです: | |
347 | ||
348 | $v = version->new(1.002); # 1.002, but compares like 1.2.0 | |
349 | $v = version->new(1.002003); # 1.002003 | |
350 | $v2 = version->new("1.2.3"); # v1.2.3 | |
351 | ||
352 | 160 | =begin original |
353 | 161 | |
354 | I | |
162 | If you have used a decimal $VERSION in the past and wish to switch to a | |
355 | ||
163 | dotted-decimal $VERSION, then you need to make a one-time conversion to | |
356 | ||
164 | the new format. | |
357 | will be stringified as L<Normal Form>. | |
358 | 165 | |
359 | 166 | =end original |
360 | 167 | |
361 | ||
168 | 過去に 10 進数 $VERSION を使っていて、ドット付き 10 進数 $VERSION に | |
362 | ||
169 | 切り替えたいなら、一度だけ新しい形式に変換する必要があります。 | |
363 | 文字列化します。 | |
364 | L<Extended Versions> として初期化されたバージョン番号は | |
365 | L<Normal Form> として文字列化されます。 | |
366 | 170 | |
367 | =head2 Numeric Versions | |
368 | ||
369 | (数値バージョン) | |
370 | ||
371 | 171 | =begin original |
372 | 172 | |
373 | ||
173 | B<Important Note>: you must ensure that your new $VERSION is numerically | |
374 | a | |
174 | greater than your current decimal $VERSION; this is not always obvious. First, | |
375 | ||
175 | convert your old decimal version (e.g. 1.02) to a normalized dotted-decimal | |
376 | ||
176 | form: | |
377 | zeros are implied so that a minimum of three places is maintained | |
378 | between subversions. What this means is that any subversion (digits | |
379 | to the right of the decimal place) that contains less than three digits | |
380 | will have trailing zeros added to make up the difference, but only for | |
381 | purposes of comparison with other version objects. For example: | |
382 | 177 | |
383 | 178 | =end original |
384 | 179 | |
385 | ||
180 | B<重要な注意>: 新しい $VERSION は数値的に現在の 10 進数 $VERSION より | |
386 | ||
181 | 大きくしなければなりません; これは常に自明というわけではありません。 | |
387 | 数 | |
182 | 最初に、古い 10 進数バージョン (例えば 1.02) をドット付き 10 進数形式に | |
388 | ||
183 | 変換します: | |
389 | 最小値は下位バージョン間で保持されます。 | |
390 | これが意味するのは、3 桁より少ない桁数の下位バージョン (小数点より | |
391 | 右の数字) は全て末尾への0の追加によって補われますが、しかしそれは他の | |
392 | バージョンオブジェクトとの比較のためだけです。 | |
393 | 例えば: | |
394 | 184 | |
395 | | |
185 | $ perl -Mversion -e 'print version->parse("1.02")->normal' | |
396 | | |
186 | v1.20.0 | |
397 | $v = version->new( 1.02); # 1.02 v1.20.0 | |
398 | $v = version->new( 1.002); # 1.002 v1.2.0 | |
399 | $v = version->new( 1.0023); # 1.0023 v1.2.300 | |
400 | $v = version->new( 1.00203); # 1.00203 v1.2.30 | |
401 | $v = version->new( 1.002003); # 1.002003 v1.2.3 | |
402 | 187 | |
403 | 188 | =begin original |
404 | 189 | |
405 | ||
190 | Then increment any of the dotted-decimal components (v1.20.1 or v1.21.0). | |
406 | quoted. The important feature is that the input value contains only a | |
407 | single decimal. See also L<Alpha Versions> for how to handle | |
408 | 191 | |
409 | 192 | =end original |
410 | 193 | |
411 | ||
194 | それからドット付き 10 進数の要素のどれかをインクリメントします | |
412 | ||
195 | (v1.20.1 または v1.21.0)。 | |
413 | 扱う方法は L<Alpha Versions> も参照してください。 | |
414 | 196 | |
415 | = | |
197 | =head2 How to C<declare()> a dotted-decimal version | |
416 | 198 | |
417 | ||
199 | (ドット付き 10 進数バージョンを C<declare()> する方法) | |
418 | than 3 significant digits after the decimal place, it will be split on | |
419 | each multiple of 3, so 1.0003 is equivalent to v1.0.300, due to the need | |
420 | to remain compatible with Perl's own 5.005_03 == 5.5.30 interpretation. | |
421 | Any trailing zeros are ignored for mathematical comparison purposes. | |
422 | 200 | |
423 | ||
201 | use version 0.77; our $VERSION = version->declare("v1.2.3"); | |
424 | 202 | |
425 | 重要な注意:上述で示されているように、数値バージョンが小数点の後に 3 つを | |
426 | 超える有効桁数を含む場合、3 の各倍数で区切られるので 1.0003 は v1.0.300 と | |
427 | 等しくなります。 | |
428 | これは Perl 自身の 5.005_03 == 5.5.30 という解釈との互換性を | |
429 | 維持する必要があるためです。 | |
430 | 末尾の 0 は数学的な比較用に全て無視されます。 | |
431 | ||
432 | =head2 Extended Versions | |
433 | ||
434 | (拡張バージョン) | |
435 | ||
436 | 203 | =begin original |
437 | 204 | |
438 | The | |
205 | The C<declare()> method always creates dotted-decimal version objects. When | |
439 | ||
206 | used in a module, you B<must> put it on the same line as "use version" to | |
440 | ||
207 | ensure that $VERSION is read correctly by PAUSE and installer tools. You | |
441 | ||
208 | should also add 'version' to the 'configure_requires' section of your | |
442 | ||
209 | module metadata file. See instructions in L<ExtUtils::MakeMaker> or | |
443 | ||
210 | L<Module::Build> for details. | |
444 | 211 | |
445 | 212 | =end original |
446 | 213 | |
447 | ||
214 | C<declare()> メソッドは常にドット付き 10 進数バージョンオブジェクトを | |
448 | ||
215 | 作成します。 | |
449 | ||
216 | モジュールで使うときは、PAUSE やインストーラツールによって $VERSION が | |
450 | ||
217 | 正しく読み込まれるように "use version" と同じ行に | |
451 | ||
218 | B<書かなければなりません>。 | |
452 | また | |
219 | また、モジュールメタデータファイルの 'configure_requires' 節に 'version' を | |
453 | ||
220 | 追加するべきです。 | |
221 | 詳細については L<ExtUtils::MakeMaker> または L<Module::Build> の説明を | |
222 | 参照してください。 | |
454 | 223 | |
455 | 224 | =begin original |
456 | 225 | |
457 | ||
226 | B<Important Note>: Even if you pass in what looks like a decimal number | |
458 | a | |
227 | ("1.2"), a dotted-decimal will be created ("v1.200.0"). To avoid confusion | |
228 | or unintentional errors on older Perls, follow these guidelines: | |
459 | 229 | |
460 | 230 | =end original |
461 | 231 | |
462 | ||
232 | B<重要な注意>: 例え 10 進数のように見えるもの ("1.2") を渡しても、ドット付き | |
463 | ||
233 | 10 進数 ("v1.200.0") が作成されます。 | |
464 | ||
234 | 古い Perl での混乱や意図しないエラーを防ぐために、以下のガイドラインに | |
235 | 従ってください: | |
465 | 236 | |
466 | ||
237 | =over 2 | |
467 | $v = version->new( "v1.200"); # v1.200.0 | |
468 | $v = version->new("v1.20.0"); # v1.20.0 | |
469 | $v = qv("v1.2.3"); # v1.2.3 | |
470 | $v = qv("1.2.3"); # v1.2.3 | |
471 | $v = qv("1.20"); # v1.20.0 | |
472 | 238 | |
473 | = | |
239 | =item * | |
474 | 240 | |
475 | In general, Extended Versions permit the greatest amount of freedom | |
476 | to specify a version, whereas Numeric Versions enforce a certain | |
477 | uniformity. See also L<New Operator> for an additional method of | |
478 | initializing version objects. | |
479 | ||
480 | =end original | |
481 | ||
482 | 一般的に、拡張バージョンは最も高い自由度でバージョンを指定でき、その | |
483 | 一方で数値バージョンは一定の統一性を強制します。 | |
484 | バージョンオブジェクトのもう一つの補助的な初期化メソッドについては | |
485 | L<New Operator> も参照してください。 | |
486 | ||
487 | 241 | =begin original |
488 | 242 | |
489 | ||
243 | Always use a dotted-decimal with (at least) three components | |
490 | L<Alpha Versions>. | |
491 | 244 | |
492 | 245 | =end original |
493 | 246 | |
494 | ||
247 | 常に (少なくとも) 3 要素のあるドット付き 10 進数を使う | |
495 | 使用することができます。 | |
496 | 248 | |
497 | = | |
249 | =item * | |
498 | 250 | |
499 | (数値αバージョン) | |
500 | ||
501 | 251 | =begin original |
502 | 252 | |
503 | ||
253 | Always use a leading-v | |
504 | used with an otherwise numeric version (i.e. a single decimal point). This | |
505 | is commonly used for CPAN releases, where CPAN or CPANPLUS will ignore alpha | |
506 | versions for automatic updating purposes. Since some developers have used | |
507 | only two significant decimal places for their non-alpha releases, the | |
508 | version object will automatically take that into account if the initializer | |
509 | is quoted. For example Module::Example was released to CPAN with the | |
510 | following sequence of $VERSION's: | |
511 | 254 | |
512 | 255 | =end original |
513 | 256 | |
514 | ||
257 | 常に先頭の v を使う | |
515 | アルファ形式が他の数値バージョン (すなわち小数点が一つ) と一緒に | |
516 | 使われていたときです。 | |
517 | これはよく CPAN リリースに使われており、そこで CPAN や | |
518 | CPANPLUS は自動アップデートのためにアルファバージョンを無視します。 | |
519 | 非アルファリリースに小数の有効桁数を2としていた開発者がいたため、 | |
520 | バージョンオブジェクトは初期化子がクォートされていれば自動的に | |
521 | それを考慮します。 | |
522 | 例えば、Module::Example が以下の $VERSION 系列で CPAN に | |
523 | リリースされたとします: | |
524 | 258 | |
525 | ||
259 | =item * | |
526 | 0.01 0.01 | |
527 | 0.02 0.02 | |
528 | 0.02_01 0.02_01 | |
529 | 0.02_02 0.02_02 | |
530 | 0.03 0.03 | |
531 | etc. | |
532 | 260 | |
533 | 261 | =begin original |
534 | 262 | |
535 | ||
263 | Always quote the version | |
536 | that was used to initialize the version object. | |
537 | 264 | |
538 | 265 | =end original |
539 | 266 | |
540 | ||
267 | 常にバージョンをクォートする | |
541 | 使われるのと同じ文字列です。 | |
542 | 268 | |
543 | =head2 Object Methods | |
544 | ||
545 | (オブジェクトメソッド) | |
546 | ||
547 | =begin original | |
548 | ||
549 | Overloading has been used with version objects to provide a natural | |
550 | interface for their use. All mathematical operations are forbidden, | |
551 | since they don't make any sense for base version objects. Consequently, | |
552 | there is no overloaded numification available. If you want to use a | |
553 | version object in a numeric context for some reason, see the L<numify> | |
554 | object method. | |
555 | ||
556 | =end original | |
557 | ||
558 | バージョンオブジェクトの利用にとって自然なインタフェースを提供するために、 | |
559 | オーバーロードが使われてきました。 | |
560 | 数学的な演算は全て、ベースのバージョンオブジェクトに対して意味を | |
561 | 成さないので、禁止されています。 | |
562 | その結果、オーバーロードされた数値化は存在せず利用できません。 | |
563 | もし何らかの理由でバージョンオブジェクトを数値コンテキストで使用したい | |
564 | 場合は、オブジェクトメソッドの L<numify> を参照してください。 | |
565 | ||
566 | =over 4 | |
567 | ||
568 | =item * New Operator | |
569 | ||
570 | (new 演算子) | |
571 | ||
572 | =begin original | |
573 | ||
574 | Like all OO interfaces, the new() operator is used to initialize | |
575 | version objects. One way to increment versions when programming is to | |
576 | use the CVS variable $Revision, which is automatically incremented by | |
577 | CVS every time the file is committed to the repository. | |
578 | ||
579 | =end original | |
580 | ||
581 | 全ての OO インタフェースと同様に、new() 演算子はバージョンオブジェクトを | |
582 | 初期化するために使われます。 | |
583 | プログラミング時にバージョンをインクリメントするための方法の一つは | |
584 | CVS 変数の $Revision を使うことです。 | |
585 | $Revision はファイルがリポジトリにコミットされた際に毎回 CVS によって | |
586 | 自動的にインクリメントされます。 | |
587 | ||
588 | =begin original | |
589 | ||
590 | In order to facilitate this feature, the following | |
591 | code can be employed: | |
592 | ||
593 | =end original | |
594 | ||
595 | この機能を容易に行うために、以下のコードが利用できます: | |
596 | ||
597 | $VERSION = version->new(qw$Revision: 2.7 $); | |
598 | ||
599 | =begin original | |
600 | ||
601 | and the version object will be created as if the following code | |
602 | were used: | |
603 | ||
604 | =end original | |
605 | ||
606 | これにより、以下のコードが使われたかのようにバージョンオブジェクトが | |
607 | 作成されます: | |
608 | ||
609 | $VERSION = version->new("v2.7"); | |
610 | ||
611 | =begin original | |
612 | ||
613 | In other words, the version will be automatically parsed out of the | |
614 | string, and it will be quoted to preserve the meaning CVS normally | |
615 | carries for versions. The CVS $Revision$ increments differently from | |
616 | numeric versions (i.e. 1.10 follows 1.9), so it must be handled as if | |
617 | it were a L<Extended Version>. | |
618 | ||
619 | =end original | |
620 | ||
621 | 言い換えると、構文解析により文字列からバージョンが自動的に取り出され、 | |
622 | CVS が通常バージョンで伝える意味を保つためにそれがクォートされます。 | |
623 | CVS の $Revision$ は数値バージョンとは異なった方法でインクリメントされる | |
624 | (すなわち 1.9 の後に 1.10 が続く) ので、それが L<Extended Versions> で | |
625 | あるかのように扱わなければなりません。 | |
626 | ||
627 | =begin original | |
628 | ||
629 | A new version object can be created as a copy of an existing version | |
630 | object, either as a class method: | |
631 | ||
632 | =end original | |
633 | ||
634 | 新しいバージョンオブジェクトは既存のバージョンオブジェクトのコピーとして | |
635 | 作成可能で、クラスメソッドとして作成する: | |
636 | ||
637 | $v1 = version->new(12.3); | |
638 | $v2 = version->new($v1); | |
639 | ||
640 | =begin original | |
641 | ||
642 | or as an object method: | |
643 | ||
644 | =end original | |
645 | ||
646 | ことも、あるいはオブジェクトメソッドとして作成する: | |
647 | ||
648 | $v1 = version->new(12.3); | |
649 | $v2 = $v1->new(12.3); | |
650 | ||
651 | =begin original | |
652 | ||
653 | and in each case, $v1 and $v2 will be identical. NOTE: if you create | |
654 | a new object using an existing object like this: | |
655 | ||
656 | =end original | |
657 | ||
658 | こともでき、それぞれの例において、$v1 と $v2 は同一です。 | |
659 | 注意: もし新しいオブジェクトを次のように既存のオブジェクトを使って | |
660 | 作成する場合: | |
661 | ||
662 | $v2 = $v1->new(); | |
663 | ||
664 | =begin original | |
665 | ||
666 | the new object B<will not> be a clone of the existing object. In the | |
667 | example case, $v2 will be an empty object of the same type as $v1. | |
668 | ||
669 | =end original | |
670 | ||
671 | 新しいオブジェクトは既存のオブジェクトのクローンには B<なりません>。 | |
672 | この例では、$v2 は $v1 と同じ種類の空のオブジェクトになります。 | |
673 | ||
674 | 269 | =back |
675 | 270 | |
676 | =over 4 | |
677 | ||
678 | =item * qv() | |
679 | ||
680 | 271 | =begin original |
681 | 272 | |
682 | ||
273 | If you really insist on using version.pm with an ordinary decimal version, | |
683 | ||
274 | use C<parse()> instead of declare. See the L<PARSING AND COMPARING VERSIONS> | |
684 | ||
275 | for details. | |
685 | the best way to initialize a short version without triggering the floating | |
686 | point interpretation. For example: | |
687 | 276 | |
688 | 277 | =end original |
689 | 278 | |
690 | ||
279 | 本当に version.pm を普通の 10 進数バージョンで使うことにこだわるなら、 | |
691 | ||
280 | declare の代わりに C<parse()> を使ってください。 | |
692 | ||
281 | 詳しくは L<PARSING AND COMPARING VERSIONS> を参照してください。 | |
693 | 厳密には他の q? 演算子 (qq, qw など) とは似ていません。 | |
694 | これは、小数点解釈を引き起こすことなしに短いバージョンを初期化するための | |
695 | 最良の方法です。 | |
696 | 例えば: | |
697 | 282 | |
698 | $v1 = qv(1.2); # 1.2.0 | |
699 | $v2 = qv("1.2"); # also 1.2.0 | |
700 | ||
701 | 283 | =begin original |
702 | 284 | |
703 | ||
285 | See also L<VERSION OBJECT DETAILS> for more on version number conversion, | |
704 | ||
286 | quoting, calculated version numbers and declaring developer or "alpha" version | |
705 | ||
287 | numbers. | |
706 | recommended that all initializers to qv() be quoted strings instead of | |
707 | bare numbers. | |
708 | 288 | |
709 | 289 | =end original |
710 | 290 | |
711 | ||
291 | バージョン番号変換、クォート、バージョン番号の計算、開発者バージョンや | |
712 | ||
292 | 「α」バージョン番号の宣言に関してさらなる情報は L<VERSION OBJECT DETAILS> も | |
713 | ||
293 | 参照してください。 | |
714 | あるので例外です。 | |
715 | この理由のため、qv() への全ての初期化子は裸の数値のかわりに | |
716 | クォートされた文字列とすることが強く推奨されます。 | |
717 | 294 | |
718 | = | |
295 | =head1 PARSING AND COMPARING VERSIONS | |
719 | 296 | |
720 | ||
297 | (バージョンのパースと比較) | |
721 | either use version with a null parameter: | |
722 | 298 | |
723 | =end original | |
724 | ||
725 | C<qv()> 関数が呼び出し側の名前空間にエクスポートされるのを防ぐために、空の | |
726 | 引数で use version を呼び出すか: | |
727 | ||
728 | use version (); | |
729 | ||
730 | 299 | =begin original |
731 | 300 | |
732 | ||
301 | If you need to compare version numbers, but can't be sure whether they are | |
302 | expressed as numbers, strings, v-strings or version objects, then you can | |
303 | use version.pm to parse them all into objects for comparison. | |
733 | 304 | |
734 | 305 | =end original |
735 | 306 | |
736 | ある | |
307 | バージョン番号を比較する必要があるけれども、バージョン番号が数値なのか | |
308 | 文字列なのかv-文字列なのかバージョンオブジェクトなのか分からない場合、 | |
309 | これら全てを比較のためにパースするために version.pm を使えます。 | |
737 | 310 | |
738 | re | |
311 | =head2 How to C<parse()> a version | |
739 | 312 | |
740 | ||
313 | (バージョンの C<parse()> の方法) | |
741 | 314 | |
742 | Both methods will prevent the import() method from firing and exporting the | |
743 | C<qv()> sub. This is true of subclasses of version as well, see | |
744 | L<SUBCLASSING> for details. | |
745 | ||
746 | =end original | |
747 | ||
748 | のいずれかを行ってください。 | |
749 | 両方のメソッドとも import() メソッドが起動して C<qv()> サブルーチンを | |
750 | エクスポートするのを防ぎます。 | |
751 | このことは version のサブクラスでも同じように成り立ちます。 | |
752 | 詳しくは L<SUBCLASSING> を参照してください。 | |
753 | ||
754 | =back | |
755 | ||
756 | 315 | =begin original |
757 | 316 | |
758 | ||
317 | The C<parse()> method takes in anything that might be a version and returns | |
318 | a corresponding version object, doing any necessary conversion along the way. | |
759 | 319 | |
760 | 320 | =end original |
761 | 321 | |
762 | ||
322 | C<parse()> メソッドはバージョンになりそうなもの何でもを取って、必要な | |
323 | 変換を行って、対応するバージョンオブジェクトを返します。 | |
763 | 324 | |
764 | ||
325 | =over 2 | |
765 | $alpha = version->new("1.2.3_4"); # see "Alpha versions" below | |
766 | $nver = version->new(1.002); # see "Numeric Versions" above | |
767 | 326 | |
768 | = | |
327 | =item * | |
769 | 328 | |
770 | =item * Normal Form | |
771 | ||
772 | (正規形式) | |
773 | ||
774 | 329 | =begin original |
775 | 330 | |
776 | ||
331 | Dotted-decimal: bare v-strings (v1.2.3) and strings with more than one | |
777 | ||
332 | decimal point and a leading 'v' ("v1.2.3"); NOTE you can technically use a | |
778 | t | |
333 | v-string or strings with a leading-v and only one decimal point (v1.2 or | |
779 | ||
334 | "v1.2"), but you will confuse both yourself and others. | |
780 | 335 | |
781 | 336 | =end original |
782 | 337 | |
783 | ||
338 | ドット付き 10 進数: 裸のv-文字列 (v1.2.3) と先頭の 'v' と複数の小数点がある | |
784 | ||
339 | 文字列 ("v1.2.3"); 注意: 技術的には小数点が一つしかないv-文字列や文字列 | |
785 | ||
340 | (v1.2 や "v1.2") も使えますが、自分自身も他人も混乱させます。 | |
786 | 先頭に 'v' が付いて返されます: | |
787 | 341 | |
788 | ||
342 | =item * | |
789 | print $ver->stringify; # ditto | |
790 | print $ver; # ditto | |
791 | print $nver->normal; # prints as v1.2.0 | |
792 | print $nver->stringify; # prints as 1.002, see "Stringification" | |
793 | 343 | |
794 | 344 | =begin original |
795 | 345 | |
796 | ||
346 | Decimal: regular decimal numbers (literal or in a string) | |
797 | normalized representation will always contain at least three sub terms. | |
798 | In other words, the following is guaranteed to always be true: | |
799 | 347 | |
800 | 348 | =end original |
801 | 349 | |
802 | ||
350 | 10 進数: (リテラルまたは文字列の中の) 普通の 10 進数 | |
803 | 3 つの下位項を持たなければなりません。 | |
804 | 言い換えると、以下のコードは常に真となることが保証されます: | |
805 | 351 | |
806 | my $newver = version->new($ver->stringify); | |
807 | if ($newver eq $ver ) # always true | |
808 | {...} | |
809 | ||
810 | 352 | =back |
811 | 353 | |
812 | =over 4 | |
813 | ||
814 | =item * Numification | |
815 | ||
816 | (数値化) | |
817 | ||
818 | 354 | =begin original |
819 | 355 | |
820 | ||
356 | Some examples: | |
821 | by default, it is possible to retrieve a number which corresponds | |
822 | to the version object through the use of the $obj->numify | |
823 | method. For formatting purposes, when displaying a number which | |
824 | corresponds a version object, all sub versions are assumed to have | |
825 | three decimal places. So for example: | |
826 | 357 | |
827 | 358 | =end original |
828 | 359 | |
829 | ||
360 | いくつかの例: | |
830 | 禁止されていますが、$obj->numify メソッドを使うことでそのバージョン | |
831 | オブジェクトに対応した数値を取り出すことが可能です。 | |
832 | フォーマッティングのために、バージョンオブジェクトに対応する数値を | |
833 | 表示する際には、下位バージョンは全て 3 桁あると仮定されます。 | |
834 | 従って、例を挙げると以下のようになります: | |
835 | 361 | |
836 | | |
362 | $variable version->parse($variable) | |
837 | | |
363 | --------- ------------------------- | |
364 | 1.23 v1.230.0 | |
365 | "1.23" v1.230.0 | |
366 | v1.23 v1.23.0 | |
367 | "v1.23" v1.23.0 | |
368 | "1.2.3" v1.2.3 | |
369 | "v1.2.3" v1.2.3 | |
838 | 370 | |
839 | 371 | =begin original |
840 | 372 | |
841 | ||
373 | See L<VERSION OBJECT DETAILS> for more on version number conversion. | |
842 | trailing zeros to preserve the correct version value. | |
843 | 374 | |
844 | 375 | =end original |
845 | 376 | |
846 | ||
377 | さらなるバージョン番号変換については L<VERSION OBJECT DETAILS> を | |
847 | ||
378 | 参照してください。 | |
848 | 379 | |
849 | = | |
380 | =head2 How to compare version objects | |
850 | 381 | |
851 | ||
382 | (バージョンオブジェクトの比較の方法) | |
852 | 383 | |
853 | =item * Stringification | |
854 | ||
855 | (文字列化) | |
856 | ||
857 | 384 | =begin original |
858 | 385 | |
859 | ||
386 | Version objects overload the C<cmp> and C<< E<lt>=E<gt> >> operators. Perl | |
860 | ||
387 | automatically generates all of the other comparison operators based on those | |
861 | ||
388 | two so all the normal logical comparisons will work. | |
862 | C<qv()> and the initializer did not have two decimal places or a leading | |
863 | 'v' (both optional), then the stringified form will have a leading 'v' | |
864 | prepended, in order to support round-trip processing. | |
865 | 389 | |
866 | 390 | =end original |
867 | 391 | |
868 | バージョンオブジェクト | |
392 | バージョンオブジェクトは C<cmp> と C<< E<lt>=E<gt> >> の演算子を | |
869 | ||
393 | オーバーロードします。 | |
870 | ||
394 | Perl はこの二つから自動的にその他の比較演算子を生成するので、通常の論理比較は | |
871 | ||
395 | 動作します。 | |
872 | 唯一の例外は、オブジェクトが C<qv()> を使って作成され、 | |
873 | 初期化子が 2 つの十進数がなかったり、先頭の 'v' がない場合 | |
874 | (これらは両方ともオプションです)、循環処理に対応するために、 | |
875 | 文字列化形式は先頭に 'v' がつきます。 | |
876 | 396 | |
877 | ||
397 | if ( version->parse($v1) == version->parse($v2) ) { | |
398 | # do stuff | |
399 | } | |
878 | 400 | |
879 | For example: | |
880 | ||
881 | =end original | |
882 | ||
883 | 例えば: | |
884 | ||
885 | Initialized as Stringifies to | |
886 | ============== ============== | |
887 | version->new("1.2") 1.2 | |
888 | version->new("v1.2") v1.2 | |
889 | qv("1.2.3") 1.2.3 | |
890 | qv("v1.3.5") v1.3.5 | |
891 | qv("1.2") v1.2 ### exceptional case | |
892 | ||
893 | 401 | =begin original |
894 | 402 | |
895 | ||
403 | If a version object is compared against a non-version object, the non-object | |
896 | w | |
404 | term will be converted to a version object using C<parse()>. This may give | |
405 | surprising results: | |
897 | 406 | |
898 | 407 | =end original |
899 | 408 | |
900 | ||
409 | バージョンオブジェクトがバージョンオブジェクトでないものと比較されると、 | |
901 | ||
410 | 非オブジェクト側は C<parse()> を使ってバージョンオブジェクトに変換されます。 | |
411 | これにより驚くべき結果になるかもしれません: | |
902 | 412 | |
903 | = | |
413 | $v1 = version->parse("v0.95.0"); | |
414 | $bool = $v1 < 0.96; # FALSE since 0.96 is v0.960.0 | |
904 | 415 | |
905 | =over 4 | |
906 | ||
907 | =item * Comparison operators | |
908 | ||
909 | (比較演算子) | |
910 | ||
911 | 416 | =begin original |
912 | 417 | |
913 | ||
418 | Always comparing to a version object will help avoid surprises: | |
914 | terms (upgrading to a version object automatically). Perl automatically | |
915 | generates all of the other comparison operators based on those two. | |
916 | In addition to the obvious equalities listed below, appending a single | |
917 | trailing 0 term does not change the value of a version for comparison | |
918 | purposes. In other words "v1.2" and "1.2.0" will compare as identical. | |
919 | 419 | |
920 | 420 | =end original |
921 | 421 | |
922 | ||
422 | 常にバージョンオブジェクトの比較を行うことは驚くことを避ける助けになります: | |
923 | バージョンオブジェクトにアップグレードします)。 | |
924 | それら 2 つに基づいて、Perl は他の比較演算子を全て自動的に生成します。 | |
925 | 以下に挙げられている明らかな等値性に加えて、末尾に 0 の項を一つ追加しても | |
926 | 比較用のバージョン値は変化しません。 | |
927 | 言い換えると、"v1.2" と"1.2.0" の比較は同一と見なされます。 | |
928 | 423 | |
929 | ||
424 | $bool = $v1 < version->parse("v0.96.0"); # TRUE | |
930 | 425 | |
931 | ||
426 | =head1 VERSION OBJECT DETAILS | |
932 | 427 | |
933 | ||
428 | (バージョンオブジェクトの詳細) | |
934 | 429 | |
935 | ||
430 | =head2 Equivalence between Decimal and Dotted-Decimal Versions | |
936 | 431 | |
937 | | |
432 | (10 進数バージョンとドット付き 10 進数バージョンの等価性) | |
938 | ------------- ---------------- ----------- | |
939 | $ver > 1.0 $ver gt "1.0" true | |
940 | $ver < 2.5 $ver lt true | |
941 | $ver != 1.3 $ver ne "1.3" true | |
942 | $ver == 1.2 $ver eq "1.2" false | |
943 | $ver == 1.2.3.4 $ver eq "1.2.3.4" see discussion below | |
944 | 433 | |
945 | 434 | =begin original |
946 | 435 | |
947 | ||
436 | When Perl 5.6.0 was released, the decision was made to provide a | |
948 | no | |
437 | transformation between the old-style decimal versions and new-style | |
949 | ||
438 | dotted-decimal versions: | |
950 | 439 | |
951 | 440 | =end original |
952 | 441 | |
953 | ||
442 | Perl 5.6.0 がリリースされたとき、古い形式の 10 進数バージョンと新しい形式の | |
954 | ||
443 | ドット付き 10 進数バージョンの変換を提供するという決定がなされました: | |
955 | Perl6 のバージョンオブジェクトは数値比較のみを | |
956 | サポートする B<かもしれません>。 | |
957 | L<Quoting> も参照してください。 | |
958 | 444 | |
959 | = | |
445 | 5.6.0 == 5.006000 | |
446 | 5.005_04 == 5.5.40 | |
960 | 447 | |
961 | WARNING: Comparing version with unequal numbers of decimal points (whether | |
962 | explicitly or implicitly initialized), may yield unexpected results at | |
963 | first glance. For example, the following inequalities hold: | |
964 | ||
965 | =end original | |
966 | ||
967 | 警告:(初期化が明示的か暗黙的かに関わらず) 小数点の数が異なるバージョンの | |
968 | 比較は一見すると期待しない結果を生み出すかもしれません。 | |
969 | 例えば、以下の非等値性が成り立ちます: | |
970 | ||
971 | version->new(0.96) > version->new(0.95); # 0.960.0 > 0.950.0 | |
972 | version->new("0.96.1") < version->new(0.95); # 0.096.1 < 0.950.0 | |
973 | ||
974 | 448 | =begin original |
975 | 449 | |
976 | ||
450 | The floating point number is taken and split first on the single decimal | |
977 | ||
451 | place, then each group of three digits to the right of the decimal makes up | |
452 | the next digit, and so on until the number of significant digits is exhausted, | |
453 | B<plus> enough trailing zeros to reach the next multiple of three. | |
978 | 454 | |
979 | 455 | =end original |
980 | 456 | |
981 | ||
457 | 浮動小数点数を取って、まず小数点で分割し、それから小数点の右側の 3 桁の | |
982 | ||
458 | グループ毎に次の数値にして、有効数字がなくなるまでこれを繰り返し、B<さらに> | |
459 | 3 の倍数になるように末尾に 0 を追加します。 | |
983 | 460 | |
984 | =back | |
985 | ||
986 | =over 4 | |
987 | ||
988 | =item * Logical Operators | |
989 | ||
990 | 461 | =begin original |
991 | 462 | |
992 | ||
463 | This was the method that version.pm adopted as well. Some examples may be | |
993 | h | |
464 | helpful: | |
994 | 465 | |
995 | 466 | =end original |
996 | 467 | |
997 | ||
468 | これは version.pm が採用している方法でもあります。 | |
998 | ||
469 | いくつかの例が助けになるでしょう: | |
999 | 470 | |
1000 | | |
471 | equivalent | |
1001 | i | |
472 | decimal zero-padded dotted-decimal | |
473 | ------- ----------- -------------- | |
474 | 1.2 1.200 v1.200.0 | |
475 | 1.02 1.020 v1.20.0 | |
476 | 1.002 1.002 v1.2.0 | |
477 | 1.0023 1.002300 v1.2.300 | |
478 | 1.00203 1.002030 v1.2.30 | |
479 | 1.002003 1.002003 v1.2.3 | |
1002 | 480 | |
1003 | = | |
481 | =head2 Quoting rules | |
1004 | 482 | |
1005 | ||
483 | (クォート規則) | |
1006 | example to prevent the use of some feature not present in the main | |
1007 | release: | |
1008 | 484 | |
1009 | =end original | |
1010 | ||
1011 | また、例えばメインリリースでは提供されない機能の使用を防ぐといった | |
1012 | 目的のために、バージョンオブジェクトが L<Alpha Versions> であるかどうかを | |
1013 | 確かめるには以下のようにします: | |
1014 | ||
1015 | $vobj = version->new("1.2_3"); # MUST QUOTE | |
1016 | ...later... | |
1017 | if ( $vobj->is_alpha ) # True | |
1018 | ||
1019 | =back | |
1020 | ||
1021 | =head2 Quoting | |
1022 | ||
1023 | (クォート) | |
1024 | ||
1025 | 485 | =begin original |
1026 | 486 | |
1027 | 487 | Because of the nature of the Perl parsing and tokenizing routines, |
1028 | 488 | certain initialization values B<must> be quoted in order to correctly |
1029 | parse as the intended version, especially when using the L< | |
489 | parse as the intended version, especially when using the L<declare> or | |
1030 | ||
490 | L<qv> methods. While you do not have to quote decimal numbers when | |
1031 | ||
491 | creating version objects, it is always safe to quote B<all> initial values | |
1032 | n | |
492 | when using version.pm methods, as this will ensure that what you type is | |
1033 | a | |
493 | what is used. | |
1034 | 494 | |
1035 | 495 | =end original |
1036 | 496 | |
1037 | Perl | |
497 | Perl のパースとトークン化ルーチンの性質により、一部の初期化値は意図している | |
1038 | バージョン | |
498 | バージョンとして正しくパースするためにクォート B<されなければなりません>; | |
1039 | 特 | |
499 | 特に L<declare> や L<qv> メソッドではです。 | |
1040 | ||
500 | バージョンオブジェクトを作成するときに 10 進数をクォートする必要がない一方、 | |
1041 | クォート | |
501 | version.pm メソッドを使うときに B<全ての> 初期値をクォートすることは常に | |
1042 | ||
502 | 安全です; 入力したものがどのように使われるかを確実にするからです。 | |
1043 | 抜け落ちてしまう場合にはそのようにならず、全く異なる | |
1044 | バージョンオブジェクトが結果として返されます。 | |
1045 | 503 | |
1046 | 504 | =begin original |
1047 | 505 | |
1048 | ||
506 | Additionally, if you quote your initializer, then the quoted value that goes | |
1049 | ||
507 | B<in> will be be exactly what comes B<out> when your $VERSION is printed | |
1050 | In ot | |
508 | (stringified). If you do not quote your value, Perl's normal numeric handling | |
1051 | ||
509 | comes into play and you may not get back what you were expecting. | |
1052 | comparison purposes. | |
1053 | 510 | |
1054 | 511 | =end original |
1055 | 512 | |
1056 | ||
513 | さらに、初期化子をクォートする場合、B<入力> としてクォートされた値は | |
1057 | ||
514 | $VERSION が表示される(文字列化される)ときに正確に同じものが | |
1058 | ||
515 | B<出力> されます。 | |
1059 | 数 | |
516 | 値をクォートしていない場合、Perl の通常の数値の処理が行われ、想定したものに | |
517 | 戻らないかもしれません。 | |
1060 | 518 | |
1061 | 519 | =begin original |
1062 | 520 | |
1063 | The complicating factor is that in bare numbers (i.e. unquoted), the | |
1064 | underscore is a legal numeric character and is automatically stripped | |
1065 | by the Perl tokenizer before the version code is called. However, if | |
1066 | a number containing one or more decimals and an underscore is quoted, i.e. | |
1067 | not bare, that is considered a L<Alpha Version> and the underscore is | |
1068 | significant. | |
1069 | ||
1070 | =end original | |
1071 | ||
1072 | ややこしくしている要因は、裸の数値 (すなわちクォートされていないもの) では | |
1073 | アンダースコアは正当な数値用の文字であって、バージョンコードが | |
1074 | 呼び出される前に Perl のトークナイザによって自動的に剥ぎ取られることです。 | |
1075 | しかしながら、もし数値が 1 つ以上の小数を含んでいてアンダースコアが | |
1076 | クォートされている場合、すなわち裸の数値ではない場合、 | |
1077 | L<Alpha Version> であると見なされてアンダースコアが有効になります。 | |
1078 | ||
1079 | =begin original | |
1080 | ||
1081 | 521 | If you use a mathematic formula that resolves to a floating point number, |
1082 | 522 | you are dependent on Perl's conversion routines to yield the version you |
1083 | 523 | expect. You are pretty safe by dividing by a power of 10, for example, |
1084 | 524 | but other operations are not likely to be what you intend. For example: |
1085 | 525 | |
1086 | 526 | =end original |
1087 | 527 | |
1088 | ||
528 | 浮動小数点数になる数値演算を行った場合、想定したバージョンが生成されるかは | |
1089 | ||
529 | Perl の変換ルーチンに依存します。 | |
1090 | 例えば | |
530 | 例えば、10 の累乗で割ることはかなり安全ですが、その他の演算はおそらく | |
1091 | ||
531 | 意図した通りにはなりません。 | |
1092 | 532 | 例えば: |
1093 | 533 | |
1094 | 534 | $VERSION = version->new((qw$Revision: 1.4)[1]/10); |
1095 | 535 | print $VERSION; # yields 0.14 |
1096 | 536 | $V2 = version->new(100/9); # Integer overflow in decimal number |
1097 | 537 | print $V2; # yields something like 11.111.111.100 |
1098 | 538 | |
1099 | 539 | =begin original |
1100 | 540 | |
1101 | Perl 5.8.1 and beyond | |
541 | Perl 5.8.1 and beyond are able to automatically quote v-strings but | |
1102 | 542 | that is not possible in earlier versions of Perl. In other words: |
1103 | 543 | |
1104 | 544 | =end original |
1105 | 545 | |
1106 | Perl 5.8.1 以降はv-文字列を | |
546 | Perl 5.8.1 以降は自動的にv-文字列をクォートできますが、それ以前の Perl では | |
1107 | ||
547 | できません。 | |
1108 | 言い換え | |
548 | 言い換えると: | |
1109 | 549 | |
1110 | 550 | $version = version->new("v2.5.4"); # legal in all versions of Perl |
1111 | 551 | $newvers = version->new(v2.5.4); # legal only in Perl >= 5.8.1 |
1112 | 552 | |
1113 | 553 | =head2 What about v-strings? |
1114 | 554 | |
1115 | 555 | (v-文字列はどう?) |
1116 | 556 | |
1117 | 557 | =begin original |
1118 | 558 | |
1119 | Beginning with Perl 5.6.0, an alternate method to code arbitrary strings | |
1120 | of bytes was introduced, called v-strings. They were intended to be an | |
1121 | easy way to enter, for example, Unicode strings (which contain two bytes | |
1122 | per character). Some programs have used them to encode printer control | |
1123 | characters (e.g. CRLF). They were also intended to be used for $VERSION, | |
1124 | but their use as such has been problematic from the start. | |
1125 | ||
1126 | =end original | |
1127 | ||
1128 | Perl 5.6.0 以降では、任意のバイト列をコーディングする代替方法が導入され、 | |
1129 | v-文字列と呼ばれています。 | |
1130 | v-文字列は、例えば (1 文字あたり 2 バイトを使う) | |
1131 | Unicode 文字列のようなものを入力するのが簡単なようになっています。 | |
1132 | プリンタ制御文字 (すなわち CRLF) をエンコードするためにv-文字列を | |
1133 | 使っているプログラムもあります。 | |
1134 | v-文字列は $VERSION のために使われるようにも意図されていましたが、 | |
1135 | そのような使用は初めから問題をはらんでいました。 | |
1136 | ||
1137 | =begin original | |
1138 | ||
1139 | 559 | There are two ways to enter v-strings: a bare number with two or more |
1140 | 560 | decimal points, or a bare number with one or more decimal points and a |
1141 | 561 | leading 'v' character (also bare). For example: |
1142 | 562 | |
1143 | 563 | =end original |
1144 | 564 | |
1145 | 565 | v-文字列を入力する方法は 2 つあります。 |
1146 | 566 | 2 つ以上の小数点を持つ裸の数値か、先頭に裸の文字 'v' があって |
1147 | 567 | 1 つ以上の小数点を持つ裸の数値です。 |
1148 | 568 | 例えば: |
1149 | 569 | |
1150 | 570 | $vs1 = 1.2.3; # encoded as \1\2\3 |
1151 | 571 | $vs2 = v1.2; # encoded as \1\2 |
1152 | 572 | |
1153 | 573 | =begin original |
1154 | 574 | |
1155 | 575 | However, the use of bare v-strings to initialize version objects is |
1156 | B<strongly> discouraged in all circumstances | |
576 | B<strongly> discouraged in all circumstances. Also, bare | |
1157 | ||
577 | v-strings are not completely supported in any version of Perl prior to | |
1158 | ||
578 | 5.8.1. | |
1159 | ensure the proper interpretation. | |
1160 | 579 | |
1161 | 580 | =end original |
1162 | 581 | |
1163 | 582 | しかしながら、バージョンオブジェクトを初期化するために裸のv-文字列を |
1164 | 使用することは、 | |
583 | 使用することは、どのような状況であっても B<強く> 非推奨です。 | |
1165 | ||
584 | また、裸の v-文字列は 5.8.1 より前のバージョンの Perl は完全には | |
1166 | ||
585 | 対応していません。 | |
1167 | L<"Extended Versions"> を直接使って適切な解釈を確実にすることが | |
1168 | より良いでしょう。 | |
1169 | 586 | |
1170 | 587 | =begin original |
1171 | 588 | |
1172 | 589 | If you insist on using bare v-strings with Perl > 5.6.0, be aware of the |
1173 | 590 | following limitations: |
1174 | 591 | |
1175 | 592 | =end original |
1176 | 593 | |
1177 | 594 | もし Perl > 5.6.0 で裸のv-文字列を使うことにこだわる場合、以下の制限に |
1178 | 595 | 注意してください。 |
1179 | 596 | |
1180 | 597 | =begin original |
1181 | 598 | |
1182 | 599 | 1) For Perl releases 5.6.0 through 5.8.0, the v-string code merely guesses, |
1183 | 600 | based on some characteristics of v-strings. You B<must> use a three part |
1184 | 601 | version, e.g. 1.2.3 or v1.2.3 in order for this heuristic to be successful. |
1185 | 602 | |
1186 | 603 | =end original |
1187 | 604 | |
1188 | 605 | Perl のリリース 5.6.0 から 5.8.0 において、v-文字列コードはv-文字列の |
1189 | 606 | いくつかの特徴に基づいて単に推測を行うのみです。 |
1190 | 607 | このヒューリスティクスが成功するためには、必ず 3 つの部分 |
1191 | 608 | (例えば 1.2.3 や v1.2.3) のバージョンを使わなければ B<なりません>。 |
1192 | 609 | |
1193 | 610 | =begin original |
1194 | 611 | |
1195 | 612 | 2) For Perl releases 5.8.1 and later, v-strings have changed in the Perl |
1196 | 613 | core to be magical, which means that the version.pm code can automatically |
1197 | 614 | determine whether the v-string encoding was used. |
1198 | 615 | |
1199 | 616 | =end original |
1200 | 617 | |
1201 | 618 | Perl のリリース 5.8.1 以降では、v-文字列は Perl コアでマジカルになるように |
1202 | 619 | 変更されました。 |
1203 | 620 | つまり、version.pm コードがv-文字列エンコーディングが使われたかどうかを |
1204 | 621 | 自動的に判断できるようになったということです。 |
1205 | 622 | |
1206 | 623 | =begin original |
1207 | 624 | |
1208 | 625 | 3) In all cases, a version created using v-strings will have a stringified |
1209 | 626 | form that has a leading 'v' character, for the simple reason that sometimes |
1210 | 627 | it is impossible to tell whether one was present initially. |
1211 | 628 | |
1212 | 629 | =end original |
1213 | 630 | |
1214 | 631 | 3) 全ての場合で、v-文字列を使って作成されたバージョンは |
1215 | 632 | 文字列化形式にしたときに先頭に 'v' の文字がつきます; |
1216 | 633 | ときどき、これが先頭に付いていたかを確認することが不可能であるという |
1217 | 634 | 単純な理由によります。 |
1218 | 635 | |
1219 | =head2 | |
636 | =head2 Alpha versions | |
1220 | 637 | |
1221 | (バージョンオブジェクトの種類) | |
1222 | ||
1223 | =begin original | |
1224 | ||
1225 | There are two types of Version Objects: | |
1226 | ||
1227 | =end original | |
1228 | ||
1229 | 2 種類のバージョンオブジェクトが存在します。 | |
1230 | ||
1231 | =over 4 | |
1232 | ||
1233 | =item * Ordinary versions | |
1234 | ||
1235 | (通常のバージョン) | |
1236 | ||
1237 | =begin original | |
1238 | ||
1239 | These are the versions that normal modules will use. Can contain as | |
1240 | many subversions as required. In particular, those using RCS/CVS can | |
1241 | use the following: | |
1242 | ||
1243 | =end original | |
1244 | ||
1245 | これらは通常のモジュールが使うバージョンです。 | |
1246 | 必要なだけ多くの下位バージョンを含むことができます。 | |
1247 | 特に、RCS/CVS を使っている人は以下のコードを使うことができます: | |
1248 | ||
1249 | $VERSION = version->new(qw$Revision: 2.7 $); | |
1250 | ||
1251 | =begin original | |
1252 | ||
1253 | and the current RCS Revision for that file will be inserted | |
1254 | automatically. If the file has been moved to a branch, the Revision | |
1255 | will have three or more elements; otherwise, it will have only two. | |
1256 | This allows you to automatically increment your module version by | |
1257 | using the Revision number from the primary file in a distribution, see | |
1258 | L<ExtUtils::MakeMaker/"VERSION_FROM">. | |
1259 | ||
1260 | =end original | |
1261 | ||
1262 | これでそのファイルに対する現在の RCS Revision が自動的に挿入されます。 | |
1263 | もしファイルがブランチに移動されれば Revision は 3 つかそれ以上の要素を | |
1264 | 持ち、そうでなければ 2 つのみを持つでしょう。 | |
1265 | これはディストリビューション内のプライマリファイルから Revision 番号を | |
1266 | 使うことでモジュールバージョンを自動的にインクリメントすることを | |
1267 | 可能にします (L<ExtUtils::MakeMaker/"VERSION_FROM"> を参照)。 | |
1268 | ||
1269 | =item * Alpha Versions | |
1270 | ||
1271 | 638 | (αバージョン) |
1272 | 639 | |
1273 | 640 | =begin original |
1274 | 641 | |
1275 | For module authors using CPAN, the convention has been to note | |
642 | For module authors using CPAN, the convention has been to note unstable | |
1276 | ||
643 | releases with an underscore in the version string. (See L<CPAN>.) version.pm | |
1277 | ||
644 | follows this convention and alpha releases will test as being newer than the | |
1278 | stable release, and less than the next stable release. For | |
645 | more recent stable release, and less than the next stable release. For | |
646 | dotted-decimal versions, only the last element may be separated by an | |
647 | underscore: | |
1279 | 648 | |
1280 | 649 | =end original |
1281 | 650 | |
1282 | 651 | CPAN を使用しているモジュール作者の間で、不安定なリリースを示すために |
1283 | バージョン文字列内にアンダースコアを付ける慣習ができています | |
652 | バージョン文字列内にアンダースコアを付ける慣習ができています。 | |
1284 | 参照 | |
653 | (L<CPAN> を参照。) | |
1285 | αリリースは、その直前 | |
654 | version.pm はこの慣例に従い、αリリースは、その直前の安定リリースよりも | |
1286 | 小さく判定されます。 | |
655 | 新しく、次の安定リリースよりも小さく判定されます。 | |
1287 | ||
656 | ドット付き 10 進数バージョンでは、最後の要素のみが下線で分離されます: | |
1288 | 657 | |
1289 | | |
658 | # Declaring | |
659 | use version 0.77; our $VERSION = version->declare("v1.2_3"); | |
1290 | 660 | |
1291 | ||
661 | # Parsing | |
662 | $v1 = version->parse("v1.2_3"); | |
663 | $v1 = version->parse("1.002_003"); | |
1292 | 664 | |
1293 | ||
665 | =head1 OBJECT METHODS | |
1294 | 666 | |
1295 | ||
667 | (オブジェクトメソッド) | |
1296 | 668 | |
1297 | ||
669 | =head2 is_alpha() | |
1298 | 670 | |
1299 | 12.03 < $alphaver < 12.04 | |
1300 | ||
1301 | 671 | =begin original |
1302 | 672 | |
1303 | ||
673 | True if and only if the version object was created with a underscore, e.g. | |
1304 | they were L<Numeric Versions>, for parsing and output purposes. The | |
1305 | underscore will be output when an alpha version is stringified, in the same | |
1306 | place as it was when input. | |
1307 | 674 | |
1308 | 675 | =end original |
1309 | 676 | |
1310 | ||
677 | バージョンオブジェクトが下線付きで作られた場合にのみ真になります; 例えば | |
1311 | L<Numeric Versions> であるかのように扱われます。 | |
1312 | αバージョンが文字列化されたときには、アンダースコアが入力時と同じ位置に | |
1313 | 出力されます。 | |
1314 | 678 | |
1315 | ||
679 | version->parse('1.002_03')->is_alpha; # TRUE | |
680 | version->declare('1.2.3_4')->is_alpha; # TRUE | |
1316 | 681 | |
1317 | ||
682 | =head2 is_qv() | |
1318 | exactly as if they were L<Extended Versions>, and will display without any | |
1319 | trailing (or leading) zeros, in the L<Version Normal> form. For example, | |
1320 | 683 | |
1321 | =end original | |
1322 | ||
1323 | 2 つ以上の小数点を持つαバージョンは完全に L<Extended Versions> で | |
1324 | あるかのように取り扱われ、バージョンの L<Normal form> で、末尾(あるいは | |
1325 | 先頭)のゼロ無しで表示されます。 | |
1326 | 例えば: | |
1327 | ||
1328 | $newver = version->new("12.3.1_1"); | |
1329 | print $newver; # v12.3.1_1 | |
1330 | ||
1331 | =back | |
1332 | ||
1333 | =head2 Replacement UNIVERSAL::VERSION | |
1334 | ||
1335 | (代替 UNIVERSAL::VERSION) | |
1336 | ||
1337 | 684 | =begin original |
1338 | 685 | |
1339 | ||
686 | True only if the version object is a dotted-decimal version, e.g. | |
1340 | UNIVERSAL::VERSION function with one that uses version objects for its | |
1341 | comparisons. The return from this operator is always the stringified form, | |
1342 | but the warning message generated includes either the stringified form or | |
1343 | the normal form, depending on how it was called. | |
1344 | 687 | |
1345 | 688 | =end original |
1346 | 689 | |
1347 | バージョンオブジェクト | |
690 | バージョンオブジェクトがドット付き 10 進数バージョンの場合にのみ真になります; | |
1348 | ||
691 | 例えば | |
1349 | 置き換えることも行います。 | |
1350 | この演算子から返されるものは常に文字列化された形式ですが、 | |
1351 | 生成された警告メッセージは、どのように呼び出されたかに依存して、 | |
1352 | 文字列化形式か Normal Form のどちらかになります。 | |
1353 | 692 | |
1354 | ||
693 | version->parse('v1.2.0')->is_qv; # TRUE | |
694 | version->declare('v1.2')->is_qv; # TRUE | |
695 | qv('1.2')->is_qv; # TRUE | |
696 | version->parse('1.2')->is_qv; # FALSE | |
1355 | 697 | |
1356 | ||
698 | =head2 normal() | |
1357 | 699 | |
1358 | =end original | |
1359 | ||
1360 | 例えば: | |
1361 | ||
1362 | package Foo; | |
1363 | $VERSION = 1.2; | |
1364 | ||
1365 | package Bar; | |
1366 | $VERSION = "1.3.5"; # works with all Perl's (since it is quoted) | |
1367 | ||
1368 | package main; | |
1369 | use version; | |
1370 | ||
1371 | print $Foo::VERSION; # prints 1.2 | |
1372 | ||
1373 | print $Bar::VERSION; # prints 1.003005 | |
1374 | ||
1375 | eval "use foo 10"; | |
1376 | print $@; # prints "foo version 10 required..." | |
1377 | eval "use foo 1.3.5; # work in Perl 5.6.1 or better | |
1378 | print $@; # prints "foo version 1.3.5 required..." | |
1379 | ||
1380 | eval "use bar 1.3.6"; | |
1381 | print $@; # prints "bar version 1.3.6 required..." | |
1382 | eval "use bar 1.004"; # note numeric version | |
1383 | print $@; # prints "bar version 1.004 required..." | |
1384 | ||
1385 | ||
1386 | 700 | =begin original |
1387 | 701 | |
1388 | ||
702 | Returns a string with a standard 'normalized' dotted-decimal form with a | |
1389 | ||
703 | leading-v and at least 3 components. | |
1390 | changed. It is always better to use the built-in comparison implicit in | |
1391 | C<use> or C<require>, rather than manually poking at C<class->VERSION> | |
1392 | and then doing a comparison yourself. | |
1393 | 704 | |
1394 | 705 | =end original |
1395 | 706 | |
1396 | ||
707 | 先頭の v と最低 3 要素ある標準の「正規化された」ドット付き 10 進数形式の | |
1397 | ||
708 | 文字列を返します。 | |
1398 | 意味します。 | |
1399 | 手動で C<class->VERSION> を使ってから自分で比較を行うより、 | |
1400 | C<use> や C<require> で暗黙に使われる組み込みの比較を使う方が | |
1401 | 常に優れています。 | |
1402 | 709 | |
1403 | ||
710 | version->declare('v1.2')->normal; # v1.2.0 | |
711 | version->parse('1.2')->normal; # v1.200.0 | |
1404 | 712 | |
1405 | ||
713 | =head2 numify() | |
1406 | 714 | |
1407 | =end original | |
1408 | ||
1409 | UNIVERSAL::VERSION の代替物は、以下のように関数として使われた際: | |
1410 | ||
1411 | print $module->VERSION; | |
1412 | ||
1413 | 715 | =begin original |
1414 | 716 | |
1415 | ||
717 | Returns a value representing the object in a pure decimal form without | |
1416 | ||
718 | trailing zeroes. | |
1417 | 719 | |
1418 | 720 | =end original |
1419 | 721 | |
1420 | ||
722 | 末尾のゼロなしの純粋な 10 進数形式のオブジェクトで表現される値を返します。 | |
1421 | 更なる詳細については L<Stringification> を参照してください。 | |
1422 | 723 | |
1423 | ||
724 | version->declare('v1.2')->numify; # 1.002 | |
725 | version->parse('1.2')->numify; # 1.2 | |
1424 | 726 | |
1425 | ( | |
727 | =head2 stringify() | |
1426 | 728 | |
1427 | 729 | =begin original |
1428 | 730 | |
1429 | ||
731 | Returns a string that is as close to the original representation as possible. | |
1430 | I | |
732 | If the original representation was a numeric literal, it will be returned the | |
1431 | y | |
733 | way perl would normally represent it in a string. This method is used whenever | |
1432 | ||
734 | a version object is interpolated into a string. | |
1433 | derived class: | |
1434 | 735 | |
1435 | 736 | =end original |
1436 | 737 | |
1437 | ||
738 | 元の表現にできるだけ近い文字列を返します。 | |
1438 | れ | |
739 | 元の表現が数値リテラルなら、perl が通常これを文字列で表現する方法で値を | |
1439 | ||
740 | 返します。 | |
1440 | ||
741 | このメソッドはバージョンオブジェクトが文字列に変換された時に使われます。 | |
1441 | 場所なので)。 | |
1442 | 例えば、これは完全に条件を満たしている派生クラスです: | |
1443 | 742 | |
1444 | | |
743 | version->declare('v1.2')->stringify; # v1.2 | |
1445 | | |
744 | version->parse('1.200')->stringify; # 1.200 | |
1446 | | |
745 | version->parse(1.02_30)->stringify; # 1.023 | |
1447 | my($self,$n)=@_; | |
1448 | my $obj; | |
1449 | # perform any special input handling here | |
1450 | $obj = $self->SUPER::new($n); | |
1451 | # and/or add additional hash elements here | |
1452 | return $obj; | |
1453 | } | |
1454 | 746 | |
1455 | = | |
747 | =head1 EXPORTED FUNCTIONS | |
1456 | 748 | |
1457 | ||
749 | (エクスポートされる関数) | |
1458 | version strings. | |
1459 | 750 | |
1460 | =e | |
751 | =head2 qv() | |
1461 | 752 | |
1462 | バージョン文字列の代替の表現形式については CPAN の L<version::AlphaBeta> も | |
1463 | 参照してください。 | |
1464 | ||
1465 | 753 | =begin original |
1466 | 754 | |
1467 | ||
755 | This function is no longer recommended for use, but is maintained for | |
1468 | ||
756 | compatibility with existing code. If you do not want to have it exported | |
1469 | ||
757 | to your namespace, use this form: | |
1470 | of the subclass. | |
1471 | 758 | |
1472 | 759 | =end original |
1473 | 760 | |
1474 | ||
761 | この関数はもはや使用を推奨されませんが、既にあるコードの互換性のために | |
1475 | ||
762 | 保守されています。 | |
1476 | ||
763 | 名前空間にこれをエクスポートしたくないときは、以下のようにします: | |
1477 | 764 | |
1478 | ||
765 | use version 0.77 (); | |
1479 | 766 | |
1480 | =begin original | |
1481 | ||
1482 | qv - Extended Version initialization operator | |
1483 | ||
1484 | =end original | |
1485 | ||
1486 | qv - 拡張バージョン初期化演算子 | |
1487 | ||
1488 | 767 | =head1 AUTHOR |
1489 | 768 | |
1490 | 769 | John Peacock E<lt>jpeacock@cpan.orgE<gt> |
1491 | 770 | |
1492 | 771 | =head1 SEE ALSO |
1493 | 772 | |
773 | L<version::Internal>. | |
774 | ||
1494 | 775 | L<perl>. |
1495 | 776 | |
1496 | 777 | =begin meta |
1497 | 778 | |
1498 | 779 | Translate: Kenji Inoue <kenz@oct.zaq.ne.jp> (0.70) |
1499 | Update: Kentaro | |
780 | Update: SHIRAKATA Kentaro <argrath@ub32.org> (0.74-) | |
781 | Status: completed | |
1500 | 782 | |
1501 | 783 | =end meta |
1502 | 784 | |
1503 | 785 | =cut |