>-- >Perhaps I'm behind the times here, but what's wrong with: > >my $num = $#array > >??
[EMAIL PROTECTED] ~]$ perl -Mstrict -Mwarnings -le 'my @arr=qw/aa bb cc/;print $#arr' 2 [EMAIL PROTECTED] ~]$ perl -Mstrict -Mwarnings -le 'my @arr=qw/aa bb cc/;print scalar @arr' 3 They are not the same. The $#arr is the last element's index number,while 'scalar @arr' is all the elements' total number. -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>