ktats****@users*****
ktats****@users*****
2012年 8月 5日 (日) 18:49:23 JST
Index: docs/articles/qntm.org/files/perl/perl.html diff -u docs/articles/qntm.org/files/perl/perl.html:1.2 docs/articles/qntm.org/files/perl/perl.html:1.3 --- docs/articles/qntm.org/files/perl/perl.html:1.2 Sun Aug 5 13:09:34 2012 +++ docs/articles/qntm.org/files/perl/perl.html Sun Aug 5 18:49:22 2012 @@ -198,9 +198,9 @@ <li>string <tt>"0"</tt>.</li> </ul> -<p>The Perl documentation <em>repeatedly</em> claims that functions return "true" or "false" values in certain situations. In practice, when a function is claimed to return "true" it usually returns <tt>1</tt>, and when it is claimed to return false it usually returns the empty string, <tt>""</tt>.</p> +<p class=original>The Perl documentation <em>repeatedly</em> claims that functions return "true" or "false" values in certain situations. In practice, when a function is claimed to return "true" it usually returns <tt>1</tt>, and when it is claimed to return false it usually returns the empty string, <tt>""</tt>.</p> -<p class=original>Perlã®ããã¥ã¡ã³ãã§ã¯ã<em>ç¹°ãè¿ã</em>ãç¹å®ã®ç¶æ³ã§"ç"ã"å½"ã®å¤ãé¢æ°ãè¿ãããã«ä¸»å¼µãã¦ãã¾ããå®éã«ã¯ã +<p>Perlã®ããã¥ã¡ã³ãã§ã¯ã<em>ç¹°ãè¿ã</em>ãç¹å®ã®ç¶æ³ã§"ç"ã"å½"ã®å¤ãé¢æ°ãè¿ãããã«ä¸»å¼µãã¦ãã¾ããå®éã«ã¯ã é¢æ°ãçãè¿ãããã«ä¸»å¼µãã¦ããã¨ãã¯ãæ®é<tt>1</tt>ãè¿ãã¾ããã¾ããé¢æ°ãå½ãè¿ãããã«ä¸»å¼µãã¦ãããªããæ®éã¯ç©ºæå<tt>""</tt>ãè¿ãã¾ãã</p> <h3 class=original>Array variables</h3> @@ -1175,8 +1175,10 @@ <h2 class=original>Built-in functions</h2> <h2>çµè¾¼é¢æ°</h2> -<p>By now you have seen at least a dozen built-in functions: <tt>print</tt>, <tt>sort</tt>, <tt>map</tt>, <tt>grep</tt>, <tt>each</tt>, <tt>keys</tt>, <tt>scalar</tt> and so on. Built-in functions are one of Perl's greatest strengths. They</p> -<ul> +<p class="original">By now you have seen at least a dozen built-in functions: <tt>print</tt>, <tt>sort</tt>, <tt>map</tt>, <tt>grep</tt>, <tt>each</tt>, <tt>keys</tt>, <tt>scalar</tt> and so on. Built-in functions are one of Perl's greatest strengths. They</p> +<p>ä»ã¾ã§ã§ãå°ãªãã¨ãããããçµè¾¼é¢æ°ãåºã¦ãã¾ãã: <tt>print</tt>, <tt>sort</tt>, <tt>map</tt>, <tt>grep</tt>, <tt>each</tt>, <tt>keys</tt>, <tt>scalar</tt> ãªã©ã çµè¾¼é¢æ°ã¯Perlã®æãå大ãªå¼·ã¿ã®ã²ã¨ã¤ã§ãããããã¯ã</p> + +<ul class="original"> <li>are numerous</li> <li>are very useful</li> <li>are extensively documented (in "perlfunc")</li> @@ -1188,13 +1190,33 @@ <li>sometimes will fill in their own arguments if too few are supplied</li> <li>generally don't require brackets around their arguments except in ambiguous circumstances</li> </ul> -<p>The best advice regarding built-in functions is to know that they exist, so that you can <strong>use them</strong>. If you are carrying out a task which feels like it's low-level and common enough that it's been done many times before, the chances are that it has.</p> +<ul> + <li>ãããããã</li> + <li>ã¨ã¦ã便å©</li> + <li>åºãããã¥ã³ãåããã¦ãã("perlfunc"ã«)</li> + <li>ã·ã³ã¿ãã¯ã¹ã§å¤§ããç°ãªãã®ã§ãããã¥ã¡ã³ããè¦ããã¨</li> + <li>å¼æ°ã¨ãã¦æ£è¦è¡¨ç¾ãåãä»ãããã®ããã</li> + <li>å¼æ°ã¨ãã¦å®å ¨ãªã³ã¼ããããã¯ãåãä»ãããã®ããã</li> + <li>å¼æ°ã®éã«ã³ã³ããä¸è¦ãªãã®ããã</li> + <li>ã³ã³ãã§åºåãããä»»æã®æ°ãåããã®ãããã°ãããã§ãªããã®ããã</li> + <li>å¼æ°ãå°ãªãããå ´åã«ãèªåèªèº«ã§å¼æ°ãåãããã®ããã</li> + <li>ææ§ãªç¶æ³ã§ãªããã°ãä¸è¬çã«å¼æ°ã®ã¾ããã«æ¬å¼§ã¯ä¸è¦</li> +</ul> +<p class=original>The best advice regarding built-in functions is to know that they exist, so that you can <strong>use them</strong>. If you are carrying out a task which feels like it's low-level and common enough that it's been done many times before, the chances are that it has.</p> +<p>çµè¾¼é¢æ°ãåå¨ãã¦ãããã¨ãç¥ããã¨ã«é¤¨ããæãè¯ãã¢ããã¤ã¹ã¯ã<strong>使ã£ã¦ã¿ã</strong>ãã¨ã§ããä½ã¬ãã«ã§ä»¥åã«ä½åº¦ãè¡ã£ã¦ããååã«å ±éã ã¨æããã¿ã¹ã¯ãå®è¡ãã¦ãããªãããã®ãã£ã³ã¹ã§ãã</p> + +<h2 class=original>User-defined subroutines</h2> +<h2>ã¦ã¼ã¶ã¼å®ç¾©ã®ãµãã«ã¼ãã³</h2> + +<p class=original>Subroutines are declared using the <tt>sub</tt> keyword. In contrast with built-in functions, user-defined subroutines always accept the same input: a list of scalars. That list may of course have a single element, or be empty. A single scalar is taken as a list with a single element. A hash with <var>N</var> elements is taken as a list with 2<var>N</var> elements.</p> + +<p>ãµãã«ã¼ãã³ã¯<tt>sub</tt> ãã¼ã¯ã¼ãã使ã£ã¦å®£è¨ããã¾ããçµè¾¼é¢æ°ã¨å¯¾ç §çã«ãã¦ã¼ã¶ã¼å®ç¾©ã®ãµãã«ã¼ãã³ã¯å¸¸ã«åãå ¥åãåãä»ãã¾ã: ã¹ã«ã©ã®ãªã¹ãã§ãããã®ãªã¹ãã¯ããã¡ãããã²ã¨ã¤ã®è¦ç´ ãã空ã®å ´åãããã¾ããã²ã¨ã¤ã®ã¹ã«ã©ã¯ä¸ã¤ã®è¦ç´ ã®ãªã¹ãã§ãã<var>N</var>è¦ç´ ã®ããã·ã¥ã¯2<var>N</var>è¦ç´ ã®ãªã¹ãã§ãã</p> -<h2>User-defined subroutines</h2> +<p class=original>Although the brackets are optional, subroutines should always be invoked using brackets, even when called with no arguments. This makes it clear that a subroutine call is happening.</p> +<p>æ¬å¼§ã¯ãªãã·ã§ã³ã§ããããµãã«ã¼ãã³ã¯ãå¼æ°ãã²ã¨ã¤ãç¡ãã¦ãã常ã«æ¬å¼§ä»ãã§ä½¿ãã¹ãã§ãããããã¦ããã°ããµãã«ã¼ãã³ãå¼ã°ãããã¨ããæ確ã«ãªãã¾ãã</p> -<p>Subroutines are declared using the <tt>sub</tt> keyword. In contrast with built-in functions, user-defined subroutines always accept the same input: a list of scalars. That list may of course have a single element, or be empty. A single scalar is taken as a list with a single element. A hash with <var>N</var> elements is taken as a list with 2<var>N</var> elements.</p> -<p>Although the brackets are optional, subroutines should always be invoked using brackets, even when called with no arguments. This makes it clear that a subroutine call is happening.</p> -<p>Once you're inside a subroutine, the arguments are available using the built-in array variable <tt>@_</tt>. Examples follow.</p> +<p class=original>Once you're inside a subroutine, the arguments are available using the built-in array variable <tt>@_</tt>. Examples follow.</p> +<p>ãµãã«ã¼ãã³ã®ä¸ã§ã¯ãçµè¾¼ã®é åå¤æ°<tt>@_</tt>ã使ãã¾ããä¾ã¯ä»¥ä¸ã«ç¶ãã¾ãã</p> <h3>Unpacking arguments</h3> <p>There's More Than One Way To unpack these arguments, but some are superior to others.</p>