Re: perl built in function for mean

2006-09-09 Thread John W. Krahn
Bryan Harris wrote: > >>Bryan Harris wrote: 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. > >my @data=(1,1,1); > >mean=(1+1+1)/

Re: perl built in function for mean

2006-09-09 Thread Bryan Harris
> Bryan Harris wrote: >> >>> 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. my @data=(1,1,1); mean=(1+1+1)/3=1;(Any perl bui

Re: splitting the line correctly

2006-09-09 Thread John W. Krahn
Robert Krueger wrote: > Hi, Hello, > I bought 3 books a few days ago on Perl, and things are going well with > one exception. > > An example: > > @line = "this is a very long line word1+word2+word3 and it contines on and > on"; > > The object is to execute a split using "+" so I end up with w

Re: Syntax Error

2006-09-09 Thread John W. Krahn
AndrewMcHorney wrote: > Hello Hello, > I do not have my perl books with me and so I cannot diagnose the error I > am getting with several if statements. Could someone assist? Do you have the Perl documentation installed on your hard drive? perldoc perldiag > Here is the code: > > #! /bin/per

Re: splitting the line correctly

2006-09-09 Thread Rob Dixon
Robert Krueger wrote: > Hi, > I bought 3 books a few days ago on Perl, and things are going well with > one exception. > > An example: > > @line = "this is a very long line word1+word2+word3 and it contines on and on"; > > The object is to execute a split using "+" so I end up with word1, word2,

Re: Syntax Error

2006-09-09 Thread Tom Phoenix
On 9/9/06, AndrewMcHorney <[EMAIL PROTECTED]> wrote: I do not have my perl books with me and so I cannot diagnose the error I am getting with several if statements. What line is the error? What's the error message? Can you find the message in perldiag? if (file_deleted[compare_index] ==

Re: perl built in function for mean

2006-09-09 Thread John W. Krahn
Bryan Harris wrote: > >>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. >>> >>>my @data=(1,1,1); >>> >>>mean=(1+1+1)/3=1;(Any perl built-in function for >>>t

splitting the line correctly

2006-09-09 Thread Robert Krueger
Hi, I bought 3 books a few days ago on Perl, and things are going well with one exception. An example: @line = "this is a very long line word1+word2+word3 and it contines on and on"; The object is to execute a split using "+" so I end up with word1, word2, and word3, so I do this: my @line =

Re: perl built in function for mean

2006-09-09 Thread Bryan Harris
I can't believe I just beat John in perl golf, by 14 strokes! (Anyone who knows me knows I just got lucky on that hole...) - B > chen li wrote: >> Dear all, > > Hello, > >> 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

Syntax Error

2006-09-09 Thread AndrewMcHorney
Hello I do not have my perl books with me and so I cannot diagnose the error I am getting with several if statements. Could someone assist? Here is the code: #! /bin/perl # # Create the files to delete list file # # # Find all the files # print "Extracting files in directory"; @file_list =

Re: perl built in function for mean

2006-09-09 Thread John W. Krahn
chen li wrote: > Dear all, Hello, > 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. > > my @data=(1,1,1); > > mean=(1+1+1)/3=1;(Any perl built-in function for > this?) my $mean

Re: perl built in function for mean

2006-09-09 Thread Bryan Harris
$mean = eval(join("+", @data)) / @data; I love perl golf. =) - B > Dear all, > > 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. > > Thanks, > > Li > > my @data=(1,1,1

Re: perl built in function for mean

2006-09-09 Thread chen li
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

Re: Sockets

2006-09-09 Thread Jack Faley ( The Tao of Jack )
On 9/9/06, elite elite <[EMAIL PROTECTED]> wrote: Does anyone know any good links on networking with perl or on sockets? check out docs for IO::Socket How about books? Both at Amazon at the very least: Network Programming with Perl by Lincoln D. Stein, Addison-Wesley Professional Progr

Re: perl built in function for mean

2006-09-09 Thread Xavier Noria
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/b

Re: perl built in function for mean

2006-09-09 Thread Randal L. Schwartz
> "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 ar

Re: perl built in function for mean

2006-09-09 Thread Xavier Noria
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. There are modules, but nothing builtin. -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

perl built in function for mean

2006-09-09 Thread chen li
Dear all, 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. Thanks, Li my @data=(1,1,1); mean=(1+1+1)/3=1;(Any perl built-in function for this?) _

Re: Sockets

2006-09-09 Thread Randal L. Schwartz
> "elite" == elite elite <[EMAIL PROTECTED]> writes: elite> Does anyone know any good links on networking with elite> perl or on sockets? Are you just curious, or are you inventing a new protocol? Because if you're not either of those, there are modules that handle almost every major protoco

Re: prototype?

2006-09-09 Thread Randal L. Schwartz
And without reading that article, the essence is AVOID PROTOTYPES AT ALL COSTS mmm.. ok? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraini

Re: Environment veriable

2006-09-09 Thread Rob Dixon
Jack Faley ( The Tao of Jack ) wrote: > > On 9/9/06, john wright <[EMAIL PROTECTED] wrote: >> >> *"Jack Faley ( The Tao of Jack )" < [EMAIL PROTECTED] wrote: >>> >>> On 9/8/06, john wright wrote: I want to call vcvars32.bat from perl script and effectively borrow the variables from

Re: Environment veriable

2006-09-09 Thread Jack Faley ( The Tao of Jack )
Hi, Perl should inherit whatever the environment shell it is called in. Id be interested to know if you listed you environment variables before calling perl if they are there. I just had to write code for perl last week ( on UNIX) concerning environment variables. It was being called from a prog

Re: Sockets

2006-09-09 Thread jeffhua
Lincoln Stein's great book of 'Network Programming with Perl' is very good for your purpose. -Original Message- From: [EMAIL PROTECTED] To: beginners@perl.org Sent: Sat, 9 Sep 2006 7:56 PM Subject: Sockets Does anyone know any good links on networking with perl or on sockets?

Sockets

2006-09-09 Thread elite elite
Does anyone know any good links on networking with perl or on sockets? __ 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,

Re: Environment veriable

2006-09-09 Thread john wright
Hi I am calling vcvars32.bat using system call in perl program,but the variables set in the batch file are lost when the execution come out of the system call.i want preserve all variables values define in the vcvars32.bat in my perl program after executing the vcvars32.bat. Thanks