Well I guess I was just not sure of the syntax @{} being able to dereference something like a $sth-&gt;selectall_arrayref({}) in DBI.pm.&nbsp; But now i've saved several unnecessary steps by learning that.<br><br><div><span class="gmail_quote">
On 12/7/05, <b class="gmail_sendername">Michael J. Freeman</b> &lt;<a href="mailto:mfreeman@netcogov.com">mfreeman@netcogov.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Why do you want to copy that hash to $b though? Why not just dereference $a? I<br>use to do this myself a lot before I got the hang of referencing and then got<br>bitten by it.<br><br>On Wednesday 07 December 2005 08:14, Eric Estabrooks wrote:
<br>&gt; Ken Williams wrote:<br>&gt; &gt;Double correction, it should have been:<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp; $a = {b =&gt; [1,2,3]}<br>&gt; &gt;<br>&gt; &gt;The solution you're looking for is:<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp; @result = @{ $b-&gt;{b} };
<br>&gt;<br>&gt; I hate to disagree but you need to do a double dereference on $b since<br>&gt; its a ref to a scalar that holds a ref to a hash.&nbsp;&nbsp;If you want to just<br>&gt; have a single dereference then it would be a sort of combination of the
<br>&gt; two corrections.<br>&gt;<br>&gt; %a = (b =&gt; [1,2,3]);<br>&gt; $b = \%a;<br>&gt; @c = @{ $b-&gt;{b} };<br>&gt; $val = $b-&gt;{b}[1];<br>&gt;<br>&gt; Eric<br>&gt;<br>&gt; &gt;The rule is that following the '@' character must either be the name of
<br>&gt; &gt;an array (such as &quot;result&quot; above, or a simple scalar such as $x (e.g.<br>&gt; &gt;@$x) that holds an array reference, or brackets that evaluate to a name<br>&gt; &gt;or an array reference.<br>&gt; &gt;
<br>&gt; &gt;If you're running under &quot;strict&quot; mode, no evaluation is allowed in the<br>&gt; &gt;latter &quot;name&quot; case, it must be a literal name (e.g. @{ result }).<br>&gt; &gt;<br>&gt; &gt;The following code demonstrates a few ways of accessing the same array:
<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;@x = (1..10);<br>&gt; &gt;&nbsp;&nbsp;print @x;&nbsp;&nbsp;# Literal<br>&gt; &gt;&nbsp;&nbsp;$y = \@x;<br>&gt; &gt;&nbsp;&nbsp;print @$y;&nbsp;&nbsp;# Hard reference<br>&gt; &gt;&nbsp;&nbsp;print @{\@x}; # Hard reference<br>&gt; &gt;&nbsp;&nbsp;print @{&quot;x&quot;}; # Soft reference
<br>&gt; &gt;&nbsp;&nbsp;print @{lc(&quot;X&quot;)}; # Soft reference<br>&gt; &gt;<br>&gt; &gt;Of course, if you want to address individual elements of your $b-&gt;{b}<br>&gt; &gt;structure, you can just use $b-&gt;{b}[0], $b-&gt;{b}[1], etc.
<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;-Ken<br>&gt; &gt;<br>&gt; &gt;On Dec 6, 2005, at 9:41 PM, Dave Dash wrote:<br>&gt; &gt;&gt;Actually correction that should be<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;%a = {b =&gt; [1,2,3]}<br>&gt; &gt;&gt;
<br>&gt; &gt;&gt;On 12/6/05, Dave Dash &lt;<a href="mailto:dd@davedash.com">dd@davedash.com</a>&gt; wrote:Let's say I have a hash:<br>&gt; &gt;&gt;&gt;$a = {b=&gt;(1,2,3)}<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;and<br>&gt; &gt;&gt;&gt;
<br>&gt; &gt;&gt;&gt;$b = \$a;<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; Is there a way given $b-&gt;{b} to dereference that into the array that<br>&gt; &gt;&gt;&gt;is (1,2,3) ?<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;Currently I end up doing a lot of annoying steps, but it'd be nice if
<br>&gt; &gt;&gt;&gt;something like @($b-&gt;{b}) would work...<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt;--<br>&gt; &gt;&gt;&gt;Dave Dash<br>&gt; &gt;&gt;&gt;612.670.0621<br>&gt; &gt;&gt;&gt;3555 Fremont Ave S, Mpls, MN 55408
<br>&gt; &gt;&gt;&gt;<a href="http://citybikemap.com/">http://citybikemap.com/</a><br>&gt; &gt;&gt;&gt;<a href="http://davedash.com/">http://davedash.com/</a><br>&gt; &gt;&gt;&gt;AIM: davesdash<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;--
<br>&gt; &gt;&gt;Dave Dash<br>&gt; &gt;&gt;612.670.0621<br>&gt; &gt;&gt;3555 Fremont Ave S, Mpls, MN 55408<br>&gt; &gt;&gt;<a href="http://citybikemap.com/">http://citybikemap.com/</a><br>&gt; &gt;&gt; <a href="http://davedash.com/">
http://davedash.com/</a><br>&gt; &gt;&gt;AIM: davesdash_______________________________________________<br>&gt; &gt;&gt;Mpls-pm mailing list<br>&gt; &gt;&gt;<a href="mailto:Mpls-pm@pm.org">Mpls-pm@pm.org</a><br>&gt; &gt;&gt;
<a href="http://mail.pm.org/mailman/listinfo/mpls-pm">http://mail.pm.org/mailman/listinfo/mpls-pm</a><br>&gt; &gt;<br>&gt; &gt;_______________________________________________<br>&gt; &gt;Mpls-pm mailing list<br>&gt; &gt;<a href="mailto:Mpls-pm@pm.org">
Mpls-pm@pm.org</a><br>&gt; &gt;<a href="http://mail.pm.org/mailman/listinfo/mpls-pm">http://mail.pm.org/mailman/listinfo/mpls-pm</a><br><br>--<br>Michael J. Freeman<br>NMS Development<br>Netco Government Services, Inc.<br>
--<br>The world is full of willing people, some willing to work, the rest willing to<br>let them.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- Robert Frost<br><br><br><br>_______________________________________________<br>Mpls-pm mailing list<br><a href="mailto:Mpls-pm@pm.org">
Mpls-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/mpls-pm">http://mail.pm.org/mailman/listinfo/mpls-pm</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Dave Dash<br>612.670.0621<br>3555 Fremont Ave S, Mpls, MN 55408
<br><a href="http://citybikemap.com/">http://citybikemap.com/</a><br><a href="http://davedash.com/">http://davedash.com/</a><br>AIM: davesdash