documentation for the split command; webpage issues
[email protected] (Anša Vernerová) Tue, 19 Jun 2012 09:58:17 +0200
| Newsgroups | perl.documentation |
|---|---|
| Message-ID | <CABBLTzwZFuqH7eVk_VUA+CzvxNVtyfb6H2f+NoejsCEi+oretw@mail.gmail.com> |
--20cf3068480335035404c2cea5ac
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hello,
I would like to report that the current documentation for the split command
is erronerrous.
http://perldoc.perl.org/functions/split.html says:
--
In time-critical applications, it is worthwhile to avoid splitting into
more fields than necessary. Thus, when assigning to a list, if LIMIT is
omitted (or zero), then LIMIT is treated as though it were one larger than
the number of variables in the list; for the following, LIMIT is implicitly
4:
1. ($login, $passwd, $remainder) =3D split
<http://perldoc.perl.org/functions/split.html>(/:/);
--
Calling the third argument $remainer is simply wrong - the remainder is the
fourth argument, which is not assigned to anything. This must come from
some edit of the older version of the documentation, which can be found
e.g. at http://www.tu-chemnitz.de/docs/perldoc-html/functions/split.html :
--
The LIMIT parameter can be used to split a line partially
($login, $passwd, $remainder) =3D split
<http://www.tu-chemnitz.de/docs/perldoc-html/functions/split.html>(/:/,
$_, 3);
When assigning to a list, if LIMIT is omitted, or zero, Perl supplies a
LIMIT one larger than the number of variables in the list, to avoid
unnecessary work. For the list above LIMIT would have been 4 by default. In
time critical applications it behooves you not to split into more fields
than you really need.
--
When I wanted to report this, I found it hard to find out where and how I
should report. There is a contacts section at the bottom of the page, but
neither Joe Allen's link nor the link to the project page seem to work -
and reporting to the perl 5 porters list did not seem adequate. So I hope
this is the right list to report such issues.
An=C5=A1a
--20cf3068480335035404c2cea5ac
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hello,<br><br>I would like to report that the current documentation for the=
<span style=3D"font-family:courier new,monospace">split</span> command is =
erronerrous. <br><a href=3D"http://perldoc.perl.org/functions/split.html">h=
ttp://perldoc.perl.org/functions/split.html</a> says:<br>
<br><p>--</p><p>In time-critical applications, it is worthwhile to avoid sp=
litting
into more fields than necessary. Thus, when assigning to a list,
if LIMIT is omitted (or zero), then LIMIT is treated as though it
were one larger than the number of variables in the list; for the
following, LIMIT is implicitly 4:</p>
<pre class=3D"verbatim"><ol><li> <span class=3D"s">(</span><span class=
=3D"i">$login</span><span class=3D"cm">,</span> <span class=3D"i">$passwd</=
span><span class=3D"cm">,</span> <span class=3D"i">$remainder</span><span c=
lass=3D"s">)</span> =3D <a class=3D"l_k" href=3D"http://perldoc.perl.org/fu=
nctions/split.html">split</a><span class=3D"s">(</span><span class=3D"q">/:=
/</span><span class=3D"s">)</span><span class=3D"sc">;</span></li>
</ol></pre>--<br><br><br>Calling the third argument $remainer is simply wro=
ng - the remainder is the fourth argument, which is not assigned to anythin=
g. This must come from some edit of the older version of the documentation,=
which can be found e.g. at <a href=3D"http://www.tu-chemnitz.de/docs/perld=
oc-html/functions/split.html">http://www.tu-chemnitz.de/docs/perldoc-html/f=
unctions/split.html</a> :<br>
<br>--<br><p>The LIMIT parameter can be used to split a line partially</p>
<pre class=3D"verbatim"> <span class=3D"s">(</span><span class=3D"i">$lo=
gin</span><span class=3D"cm">,</span> <span class=3D"i">$passwd</span><span=
class=3D"cm">,</span> <span class=3D"i">$remainder</span><span class=3D"s"=
>)</span> =3D <a class=3D"l_k" href=3D"http://www.tu-chemnitz.de/docs/perld=
oc-html/functions/split.html">split</a><span class=3D"s">(</span><span clas=
s=3D"q">/:/</span><span class=3D"cm">,</span> <span class=3D"i">$_</span><s=
pan class=3D"cm">,</span> <span class=3D"n">3</span><span class=3D"s">)</sp=
an><span class=3D"sc">;</span></pre>
<p>When assigning to a list, if LIMIT is omitted, or zero, Perl supplies
a LIMIT one larger than the number of variables in the list, to avoid
unnecessary work. For the list above LIMIT would have been 4 by
default. In time critical applications it behooves you not to split
into more fields than you really need.</p><p>--<br></p><br>When I wanted to=
report this, I found it hard to find out where and how I should report. Th=
ere is a contacts section at the bottom of the page, but neither Joe Allen&=
#39;s link nor the link to the project page seem to work - and reporting to=
the perl 5 porters list did not seem adequate. So I hope this is the right=
list to report such issues.<br>
<br>An=C5=A1a<br clear=3D"all"><br>
--20cf3068480335035404c2cea5ac--