Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>print</code>, <code>open</code>, <code>split</code> are not subroutines. They do not result in sub calls. They are not even present in the symbol table (in <code>main::</code> or otherwise, although you can refer to them as <code>CORE::split</code>, etc), and one cannot get a reference to their code (although work is being done to create proxy subs for them in <code>CORE::</code> for when you want to treat them as subroutines). They are operators just like <code>+</code>.</p> <pre><code>$ perl -MO=Concise,-exec -e'sub f {} f()' 1 &lt;0&gt; enter 2 &lt;;&gt; nextstate(main 2 -e:1) v:{ 3 &lt;0&gt; pushmark s 4 &lt;#&gt; gv[*f] s 5 &lt;1&gt; entersub[t3] vKS/TARG,1 &lt;--- sub call 6 &lt;@&gt; leave[1 ref] vKP/REFC -e syntax OK $ perl -MO=Concise,-exec -e'split /;/' 1 &lt;0&gt; enter 2 &lt;;&gt; nextstate(main 1 -e:1) v:{ 3 &lt;/&gt; pushre(/";"/) s/64 4 &lt;#&gt; gvsv[*_] s 5 &lt;$&gt; const[IV 0] s 6 &lt;@&gt; split[t2] vK &lt;--- not a sub call 7 &lt;@&gt; leave[1 ref] vKP/REFC -e syntax OK $ perl -MO=Concise,-exec -e'$x + $y' 1 &lt;0&gt; enter 2 &lt;;&gt; nextstate(main 1 -e:1) v:{ 3 &lt;#&gt; gvsv[*x] s 4 &lt;#&gt; gvsv[*y] s 5 &lt;2&gt; add[t3] vK/2 &lt;--- Just like this 6 &lt;@&gt; leave[1 ref] vKP/REFC -e syntax OK </code></pre> <p>They are known by a variety of names:</p> <ul> <li>builtin functions</li> <li>functions</li> <li>builtins</li> <li>named operators</li> </ul> <p>And most are considered to be one of the following:</p> <ul> <li>list operator</li> <li>named unary operator</li> </ul> <p>Subroutines are often called functions (as they are in C and C++), so "function" is an ambiguous word. This ambiguity appears to be the basis of your question.</p> <hr> <p>As for <code>while</code>, <code>for</code>, <code>unless</code>, etc, they are keywords used by "flow control statements"</p> <pre><code>while (f()) { g() } </code></pre> <p>and "statement modifiers"</p> <pre><code>g() while f(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload