Thanks Xavier, Since my script is pretty short I would prefer using my own codes. I don't think I need to call this module.
Li --- Xavier Noria <[EMAIL PROTECTED]> wrote: > On Sep 9, 2006, at 9:48 PM, Randal L. Schwartz > wrote: > > >>>>>> "Xavier" == Xavier Noria <[EMAIL PROTECTED]> > writes: > > > > Xavier> On Sep 9, 2006, at 9:00 PM, chen li wrote: > >>> I want to calculate the mean of an array. I know > how > >>> to let the job done by using a loop. But I just > wonder > >>> if Perl has the short-cut/built-in function for > this. > > > > Xavier> There are modules, but nothing builtin. > > > > List::Util is "built-in" as of 5.8, and back > compatible to 5.5 I > > think. > > > > use List::Util qw(sum); > > > > my $average = sum(@input) / @input; > > I know, but that's not a builtin mean(). > > > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > <http://learn.perl.org/> > <http://learn.perl.org/first-response> > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>