On Aug 27, 11:01*pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Wed, 27 Aug 2008 13:34:00 -0700 (PDT) "A. Farber" <Alexander.Far...@gmail.com> wrote:
>
> AF> * * * * $aref = $self->{CHAT}->[0];
> AF> * * * * push @response, 'chat0=' . join '', @$aref;
> AF> * * * * $self->{CHAT}->[0] = [];
>
> Actually it assigns a new value to that reference. *The old array still
> exists with the full contents if you have another reference to it (check
> $aref, for instance).
>
> AF> I wonder if I can truncate that array by
> AF> using the $aref ? Something like $#xxxx = -1;
>
> @$aref = ();
>
> or, equivalently,
>
> @{$self->{CHAT}->[0]} = ();
Oh, you're right. Thank you!
|