Re: Can't create 2d array in Perl
- From: pangj@xxxxxxxxxxxxx (Jeff Pang)
- Date: Wed, 30 Aug 2006 09:33:56 +0800 (GMT+08:00)
while(<FH>)
{
push @arr , split /\t/ ;
}
Hello,
Here you don't create a 2d array.Maybe you want this:
while(<FH>) {
push @arry,[split/\t/];
}
Then each element of @arry is a anonymous array.You can access the anonymous array's elements as:
print $arry[0]->[0];
Hope this helps.
--
Jeff Pang
NetEase AntiSpam Team
http://corp.netease.com
.
- Prev by Date: Re: accessing other array indexes other than the current of a foreach
- Next by Date: Re: Switch, Ranges and Memory
- Previous by thread: Re: Can't create 2d array in Perl
- Next by thread: Re: Print to new file for each results
- Index(es):