Re: 'my' doesn't totally isolate

From: Uri Guttman (uri_at_stemsystems.com)
Date: 06/11/04


Date: Fri, 11 Jun 2004 02:38:07 GMT


>>>>> "JB" == John Brock <jbrock@panix.com> writes:

  JB> In article <1730eb2493fa60400c1ab7af77117a22@news.teranews.com>,
  JB> Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>>> "John" == John Brock <jbrock@panix.com> writes:

  John> Hmmm.... So how am I supposed to distinguish between an array
  John> which has not been assigned to and one whose length just happens
  John> to be zero?
>>
>> You don't. The difference between the two is (ahem) undefined. :)
>>
>> defined() on aggregates is deliberately undefined, because it depends
>> on allocation strategies. You want to slow down *all* of Perl just
>> to get something you should figure out from context instead?

  JB> Well, I thought I *was* figuring it out from context. I thought
  JB> Perl had a nice little feature where I could tuck some extra
  JB> information into one variable rather than defining two. But if it
  JB> doesn't work that way then it doesn't work that way.

  JB> I guess that means I can't even trust that defined(@aaa) will always
  JB> return FALSE if I call it after calling undef(@aaa) (even though
  JB> that seems to work for me right now). Bummer!

you are not making much sense here. why should you care if an array was
allocated or not? it is not a useful boolean as you have little control
over it. what control you see is an undocumented side effect and may go
away.

now state your real problem and stop worrying about array storage
allocation and undef. it is a red herring and you should drop it now.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


Relevant Pages

  • Re: IF with nested AND
    ... Worked just fine for me with array entered. ... John C ... "Joco" wrote: ... which only works for the first cell in the ...
    (microsoft.public.excel.misc)
  • Re: script to find most common last names in a file
    ... John W. Krahn wrote: ... > splitreturns a list in list context so you need list context on the ... > splitwill store its results in the @_ array. ... >> # then creat a hash table of first and last names, ...
    (perl.beginners)
  • Re: Second minimum
    ... John D'Errico wrote: ... > Ind is the index into the row of the sorted array which ... > Now use the tags array to back out where it came from ... > preferably the same, cat. ...
    (comp.soft-sys.matlab)
  • Re: how to pass array and varaible
    ... John and Gunnar, ... > Any arguments passed in show up in the array @_. ... > of Perl created the element whether or not the element was assigned to.) ... > Assigning to the whole array @_ removes that aliasing, ...
    (perl.beginners)
  • Re: referring to control
    ... Just to add what John said, ... you could also traverse through the Controls collection and Find the required control, ... > checkboxes to an array at runtime and then use the array for indexed access ...
    (microsoft.public.dotnet.languages.csharp)