[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote on 08/03/2005 09:48:33 AM:
> 
>> 
>> Thanks, Lloyd. It worked that way. My only question now is "is that
>> returning a "reference to an array" (RTOAA)? I have to ask because 1.
>> that's the spec I'm coding to and 2. I'm so hazy on references that I
>> don't have a clue as to whether the "anonymous list" you tell me I'm
>> sending back is equivalent to an RTOAA.
>> 
>> Thanks again,
>> 
>> Deane
>> 
>> 
> 
> An anonymous list can only be referenced via a list
> reference; i.e., a simple identifier (eg, @x) is not
> associated with an anonymous list.
> Therefore, by definition, a reference to an array is being
> returned from outer_sub(). This is also indicated by the output:
> 
> $x = ARRAY(0x1a4fea0)   <== $x is reference to array
> @$x = 1 3 5 7 9         <== list dereferencing of $x provides the list
> (1,3,5,7,9)
> 
> An anonymous list exists "out there somewhere" and a program
> can only get to it through a reference. When the last
> reference to the list disappears (goes out of scope), then
> the anonymous list magically disappears, too.

I don't know whether it makes any difference to the OP's understanding,
but it probably doesn't help that you are using the incorrect
terminology here. You should s/list/array/g in the above. AFAIK there is
no such thing as an "anonymous list" or a "list reference", it should be
"anonymous array" and "array reference". You can confuse people if you
use the wrong term. For more on the difference, see 'perldoc -q
"list.+array"'. For more on anonymous arrays and array refs, see
'perldoc perlref' and 'perldoc perlreftut'.

HTH

-- 
Brian Raven
 


-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary 
companies.
-----------------------------------------------------------------------


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to