Date: Mon, 03 Sep 2001 13:45:33 +0100 From: Jasper McCrea Subject: Re: array questions Message-Id: <3B937B6D.1E3CB973@guideguide.com> "E.Chang" wrote: > > "Billy Ng" wrote in > : > > > I have 2 questions regarding the array. > > > > 1) how can I put an array into an array? If I do push(@parent, > > @child), it will add the @child's elements into @parent. But I > > each element in the array is a individual array. Do I need the use > > hash instead? > > The elements of an array are always scalars. To create an "array of > arrays" you will need to use references to arrays as the elements > rather than the arrays themselves. Read the core documentation > sections perlreftut, perlref, and perllol. The documentation in > available with your Perl installation and also online at perldoc.com. or you could do this: @array1 = (@array1, @array2); (straight from 'Learning Perl' IIRC) Jasper -- split//,'019617511192'. '17011111610114101114'. '21011141011840799901'. '17101174'; foreach(0.. # my $#_){$_[$_ # signature is too ++]^=$_[$_ # bignature --]^=$_[$_ ]^=$_[++ $_]if!($_% 2)}$g.=$_ ,chr($g)=~ /(\w)/&&($o.=$1and $g='')foreach@_; print"$o\n"