> :: ... and cute tricks should only be used in cute programs.
> :
> : I'll take that as a compliment -- thanks, John!
>
> He said cute programs, not cute programmers.
... that he thought it was a cute trick, not me.
Ha ha.
- B
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additi
Bryan Harris wrote:
:: ... and cute tricks should only be used in cute programs.
:
: I'll take that as a compliment -- thanks, John!
He said cute programs, not cute programmers.
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer
254 968-8328
Don't t
> chen li wrote:
>>
>> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
>>
>>> chen li wrote:
>>>
6)$mean = eval(join("+", @data)) / @data;
Depending on how you understand Perl and what
>>> progress
you are I prefer 6).
>>> Depending on how you understand Perl, 6 is the wors
chen li wrote:
>>>4)my $mean = do { my $s; $s += $_ for @data; $s /
>>>@data };
>
> I never see the usage of "for" like this before. Is it
> equal to the following?
Yes, except that above $s is only visible inside the code block while below $s
is visible to the file.
> And where can I find some
> > 4)my $mean = do { my $s; $s += $_ for @data; $s /
> > @data };
Hi,
I never see the usage of "for" like this before. Is it
equal to the following? And where can I find some more
like this?
my $s;
for(@data){$s += $_ ;}
my $mean=$s/@data;
Thanks,
Li
On Sun, Sep 10, 2006 at 07:12:08AM -0700, chen li wrote:
>
> 2)List::Util is "built-in" as of 5.8, and back
> compatible to 5.5
>
> use List::Util qw(sum);
>
> my $average = sum(@input) / @input;
>
>
> 6)$mean = eval(join("+", @data)) / @data;
>
> Depending on how you understand Perl a
Rob Dixon wrote:
> John W. Krahn wrote:
>> chen li wrote:
>>
>>> 5) my $mean+=$_/@data [EMAIL PROTECTED];
>>
>> That was not posted and it won't work correctly (see the NOTE at the
>> end of
>> the "Statement Modifiers" section of perlsyn.)
>
> Ruud posted it in the 'perl built in function for mea
Rob Dixon wrote:
John W. Krahn wrote:
chen li wrote:
5) my $mean+=$_/@data [EMAIL PROTECTED];
That was not posted and it won't work correctly (see the NOTE at the
end of
the "Statement Modifiers" section of perlsyn.)
Ruud posted it in the 'perl built in function for mean' thread at 7:4
John W. Krahn wrote:
chen li wrote:
5) my $mean+=$_/@data [EMAIL PROTECTED];
That was not posted and it won't work correctly (see the NOTE at the end of
the "Statement Modifiers" section of perlsyn.)
Ruud posted it in the 'perl built in function for mean' thread at 7:46 GMT this
morning (10
chen li wrote:
>
> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
>
>>chen li wrote:
>>
>>>6)$mean = eval(join("+", @data)) / @data;
>>>
>>>Depending on how you understand Perl and what
>>progress
>>>you are I prefer 6).
>>Depending on how you understand Perl, 6 is the worst
>>solution.
>
> Coul
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> chen li wrote:
> > Dear all,
>
> Hello,
>
> > Thank for replying my post. Here is the summary of
> all
> > the posssible code lines:
> >
> > Q:If Perl has the short-cut/built-in function for
> > calculating Mean/Average?
> >
> > my @data=(1,
chen li wrote:
> Dear all,
Hello,
> Thank for replying my post. Here is the summary of all
> the posssible code lines:
>
> Q:If Perl has the short-cut/built-in function for
> calculating Mean/Average?
>
> my @data=(1,1,1);
>
> mean/average=(1+1+1)/3=1;
>
> A:
>
> No Perl built-in funct
Dear all,
Thank for replying my post. Here is the summary of all
the posssible code lines:
Q:If Perl has the short-cut/built-in function for
calculating Mean/Average?
my @data=(1,1,1);
mean/average=(1+1+1)/3=1;
A:
No Perl built-in function for mean/average but there
are several ways to
13 matches
Mail list logo