<?xml version="1.0" encoding="windows-1252"?>
<node id="237" title="perlfunc:scalar" created="1999-08-24 18:42:24" updated="2005-08-14 04:16:49">
<type id="119">
perlfunc</type>
<author id="114">
gods</author>
<data>
<field name="doctext">
</field>
<field name="name">

&lt;P&gt;
scalar - force a scalar context

&lt;P&gt;
&lt;HR&gt;
</field>
<field name="synopsis">

&lt;P&gt;
scalar 
&lt;FONT SIZE=-1&gt;EXPR&lt;/FONT&gt;

&lt;P&gt;
&lt;HR&gt;
</field>
<field name="description">

&lt;P&gt;
Forces 
&lt;FONT SIZE=-1&gt;EXPR&lt;/FONT&gt; to be interpreted in scalar context and returns the value of 
&lt;FONT SIZE=-1&gt;EXPR.&lt;/FONT&gt;

&lt;P&gt;
&lt;PRE&gt;    @counts = ( scalar @a, scalar @b, scalar @c );
&lt;/PRE&gt;
&lt;P&gt;
There is no equivalent operator to force an expression to be interpolated
in list context because it's in practice never needed. If you really wanted
to do so, however, you could use the construction &lt;CODE&gt;@{&amp;#091; (some expression) &amp;#093;}&lt;/CODE&gt;, but usually a simple
&lt;CODE&gt;(some expression)&lt;/CODE&gt; suffices.

&lt;HR&gt;
</field>
</data>
</node>
