|
Posted by Bill H on June 18, 2008, 8:45 pm
Please log in for more thread options On Jun 18, 4:29=A0pm, j...@toerring.de (Jens Thoms Toerring) wrote:
> > Earlier I was trying to combing 2 arrays and totally drew a blank on
> > how to do it. I though it would be join but didn't seem to work. Can
> > someone tell me what to look up in perldoc for it?
> > I thought I could used something like @c =3D join(@a,@b); but just ende=
d
> > up with one long string.
>
> It's not clear what you mean exactly with "combine to arrays", but
> your attempt with join makes it look as you simply want to append
> the elements of @b to that of @a and have the result in a third
> array. And in that case the you're looking for too complicated a
> solution, a simple
>
> =A0 @c =3D ( @a, @b );
>
> is all you need. If you instead want to append the elements from
> @b to @a you would do
>
> =A0 push @a, @b;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Regards, Jens
> --
> =A0 \ =A0 Jens Thoms Toerring =A0___ =A0 =A0 =A0j...@toerring.de
> =A0 =A0\__________________________ =A0 =A0 =A0http://toerring.de
Thanks Jens - yeah thats what I wanted to do and I just could not
figure it out - new it was simple but I was looking for something
complex instead of thinking simple!
Bill H
|