Gossamer Forum
Home : General : Perl Programming :

Array count...

Quote Reply
Array count...
Hi. I've been playing around with this code since yesterday afternoon, and it still isn't working. It should be just simple stuff, but its just returning no value at all.

Code:
my @count_slice = split(/\n/, $wanted);
my $match = 0;
if ($#count_slice > 500) {
$match = 1;
}

my $track = 0;
foreach (@count_slice) { $track++; }
my $track = 0;

return $track;

I'm verifying that there is no entries in the array being returned by doing the counting two times (with a foreach, and $#), but why?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Array count... Andy 5551 Apr 23, 2003, 3:07 AM
Thread Re: [Andy] Array count...
Paul 5446 Apr 23, 2003, 3:19 AM
Thread Re: [Paul] Array count...
Andy 5414 Apr 23, 2003, 8:03 AM
Thread Re: [Andy] Array count...
Paul 5416 Apr 23, 2003, 8:07 AM
Post Re: [Paul] Array count...
Andy 5399 Apr 23, 2003, 8:24 AM