[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] re-initializing associative arrays



At 15.08 1998.04.22, Peter Furmonavicius wrote:
>Hello.  I was under the impression that after
>
>          $a{1} = "peter";
>          undef @a;
>
>$a{1} would have no value.  Apparently that isn't the case because $a{1}
>is still equal to "peter".
>
>Can someone tell me what is the most efficient way of re-initializing an
>array?

$a{1} sets the key 1 of hash %a to 'peter'.  This has nothing at all to do
with @a.  I think you mean C<$a[1] = "peter">, which sets the second
element of @a to 'peter'.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==               New Book:  MacPerl: Power and Ease               ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch