<?xml version="1.0" encoding="windows-1252"?>
<node id="528099" title="Re^2: Perl Idioms Explained - my $count = () = /.../g" created="2006-02-05 16:23:03" updated="2006-02-05 11:23:03">
<type id="11">
note</type>
<author id="1936">
japhy</author>
<data>
<field name="doctext">
You misunderstood me.  A list &lt;b&gt;assignment&lt;/b&gt; in scalar context returns the number of elements.  &lt;pre&gt;my $count = &lt;b&gt;(LIST1) = (LIST2)&lt;/b&gt;;&lt;/pre&gt;  The chunk in bold is the list assignment.  That is put in scalar context by the &lt;c&gt;my $count = ...&lt;/c&gt; part.

&lt;p&gt;

Please see [id://527732] for further clarification.

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-1936"&gt;
&lt;hr/&gt;
Jeff &lt;tt&gt;&lt;font color="#0000ff"&gt;[japhy]&lt;/font&gt;&lt;/tt&gt; Pinyan,
[id://371157|P.L., P.M., P.O.D, X.S.]:

&lt;a href="http://japhy.perlmonk.org/modules/"&gt;Perl&lt;/a&gt;,

&lt;a href="http://japhy.perlmonk.org/modules/Regexp-Parser/"&gt;regex&lt;/a&gt;,

and &lt;a href="http://lists.perl.org/showlist.cgi?name=perl5-porters"&gt;&lt;tt&gt;perl&lt;/tt&gt;&lt;/a&gt;

&lt;a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=hacker"&gt;hacker&lt;/a&gt;

&lt;br&gt;
&lt;i&gt;How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ &lt;b&gt;Meister Eckhart&lt;/b&gt;&lt;/i&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
527973</field>
<field name="parent_node">
528095</field>
</data>
</node>
