Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: RFC: Fuzzy Clustering with Perl

by BUU (Prior)
on Nov 03, 2006 at 20:52 UTC ( #582163=note: print w/replies, xml ) Need Help??

in reply to Re: RFC: Fuzzy Clustering with Perl
in thread RFC: Fuzzy Clustering with Perl

Just a nit:
for my $i ( 0 .. $number_of_clusters-1 ) { ... }

Should be:
for my $i ( 0 .. $#number_of_clusters ) { ... }

Update: Hrm, whups, I read that first line as "0..@number_of_clusters", apparently multiple times. It should not be "0 .. $#number_of_clusters" since @number_of_clusters doesn't exist. It might be more clearly written "1 .. $number_of_clusters" though, =]

Replies are listed 'Best First'.
Re^3: RFC: Fuzzy Clustering with Perl
by lin0 (Curate) on Nov 03, 2006 at 21:34 UTC

    Hi BUU,

    I think that the first option is the correct one because I want the loop to run for $number_of_clusters times. Because the loop starts in 0, it should go up to $number_of_clusters-1.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://582163]
[Eily]: for what it's worth I didn't go for the brightest solution either
[Eily]: I tried print eval '2+1/3*(2+2/5))' or print $@
[Eily]: and therefore concluded that the eval did succeed because there was no printed error :P
[Eily]: stupid operator precedence :D

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-10-24 10:23 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (287 votes). Check out past polls.