C language and bioinformatics

2007-01-24 Thread chen li
Hi all, It is off-topic but I just wonder if any one knows a website or books talking about reading/processing DNA sequences with C language. Thanks, Li TV dinner still cooling? Check out "Tonight's Picks"

Spreadsheet-WriteExcel and visability

2006-11-05 Thread chen li
Hi all, I download Spreadsheet::WriteExcel,read the document and try some samples. I want to find a method like "Visable" so that I can see the excel file created once the Perl script runs. Now the only thing I can do is to open the created file by myself. I wonder if such method is available. T

how to use lwp-download

2006-10-25 Thread chen li
Hi all, I need to download some files from a website. I try lwp-download and it works fine. But the problem is that it only supports downloading one file for each request. Is it possible to ask it download several files((such as files.*) by issueing one line code ? Thanks, Li ### c:\lwp-downlo

Re: reg expression again

2006-10-22 Thread chen li
--- Robin Sheat <[EMAIL PROTECTED]> wrote: > On Monday 23 October 2006 12:37, chen li wrote: > > my $file_name='OT-q1.001'; > > > > if ($file_name=~/(OT)*.(\d+$)/){ > Maybe you mean: > if ($file_name=~/^OT.*\.(\d+$)

reg expression again

2006-10-22 Thread chen li
Hi all, I write a small script as follows: use strict; use warnings; my $file_name='OT-q1.001'; if ($file_name=~/(OT)*.(\d+$)/){ print "find it\t $file_name"; }else {print "No math";} The problem is that it also macth the following string: my $file_name='I:/Common/Notebooks/Trans10C.

Re: reg expression again

2006-10-22 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > chen li wrote: > > Hi all, > > Hello, > > > I write a small script as follows: > > > > use strict; > > use warnings; > > > > my $file_name='OT-q1.001'; &g

need help for regxp

2006-10-20 Thread chen li
Hi folks, I have a folder containing a child folder and other files. I want to print out the BMDC4-2.001 to BMDC4-2.024 only and the file format is (string/number or mix).number. Which regular expression is used to do the job? Thanks, Li contents in the folder folderx Analysis-1.wsp B

Re: about PXPerl

2006-10-05 Thread chen li
--- "D. Bolliger" <[EMAIL PROTECTED]> wrote: >> > I recenlty install PXPerl on my window xp. The > > documentations come with perl6 bible stuff. Out > of > > curiosity I read some of the object section and > data > > type/variable in Perl 6. It looks like we have to > > predeclare a lot of type

about PXPerl

2006-10-05 Thread chen li
Hi all, I recenlty install PXPerl on my window xp. The documentations come with perl6 bible stuff. Out of curiosity I read some of the object section and data type/variable in Perl 6. It looks like we have to predeclare a lot of types of variables before we can use them, just like those in JAVA.

RE: question about Data::Dumper

2006-10-01 Thread chen li
> This may be a more useful test. > > use strict; > use warnings; > use Bar; > > print "Sub routine > call:\n\tBar::print_result(1,2);\n"; > my $call = Bar::print_result(1,2); > > > print "\n\nMethod > call:\n\tBar->print_result(1,2);\n"; > $call = Bar->print_result(1,2); > > __END__ >

question about Data::Dumper

2006-10-01 Thread chen li
Hi all, I write a small script to see what is the difference between calling methods and regular subroutines. Then I use Data::Dumper to see the data structure. What I expecte is to print out a string(This is the data1 1 and data2 2) after using Dumper. But here are the results I get from using D

Re: Hash problem

2006-09-28 Thread chen li
--- "Johnson, Reginald (GTI)" <[EMAIL PROTECTED]> wrote: > I am doing an example from Perl Objects, References > & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name > and I'm not sure > why. Here is my output. > > this

Re: why Perl complaints my script

2006-09-28 Thread chen li
Hi Andriano, Thank you very much, Li --- Adriano Ferreira <[EMAIL PROTECTED]> wrote: > On 9/28/06, chen li <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I write a small script for permutation. When I use > > version 1) Perl always complaint it although I

Re: why Perl complaints my script

2006-09-28 Thread chen li
Thank you very much, Li --- Igor Sutton <[EMAIL PROTECTED]> wrote: > > > > for ($k; $k>=1;$k--) {$result*=$n--;}#line > 15 > > > > You don't need to declare $k inside for (). Change > that to > > for (; $k >= 1; $k--) > > and perl won't complain about it anymore. I think > the place b

Re: why Perl complaints my script

2006-09-28 Thread chen li
Thanks, Li --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > chen li schreef: > > > for ($k; $k>=1;$k--) {$result*=$n--;} > > Alternative: > > $result *= $n-- for 1..$k ; > > -- > Affijn, Ruud > > "Gewoon is een tijger."

why Perl complaints my script

2006-09-28 Thread chen li
Hi all, I write a small script for permutation. When I use version 1) Perl always complaint it although I get the result. If I use version 2) it never says a word about it. Any comments? Thank you in advance, Li version 1)### use strict; use warnings; print permutation(5,2); # 5 choose 2

backreference in regexp

2006-09-26 Thread chen li
Hi all, I see some codes as following my $regexp= "(([gatc]{3})\\2{3,})"; my $string=~/$regexp/; What is the meaning of {3,} of in \2{3,} ? I know \2 is a backreference here but not sure {3,}. I check the camel book and some perldoc but I can't find answer. Thanks, Li

RE: backreference in regexp

2006-09-26 Thread chen li
--- Thomas Bätzler <[EMAIL PROTECTED]> wrote: > chen li <[EMAIL PROTECTED]> asekd: > > I see some codes as following > > > > my $regexp= "(([gatc]{3})\\2{3,})"; > > > > my $string=~/$regexp/; > > > > What is the meaning of {

Re: backreference in regexp

2006-09-26 Thread chen li
> Check perldoc perlre, "Regular Expressions": > > " The following standard quantifiers are > recognized: >[...] >{n}Match exactly n times >{n,} Match at least n times >{n,m} Match at least n but not more than > m times > " > > "\2{3,}"

Re: about perltoot

2006-09-24 Thread chen li
> > Hello Li > > About the _permitted hash key, the perltoot tutorial > says > > + I could have avoided the "_permitted" field > entirely, but I wanted to > + demonstrate how to store a reference to class data > on the object so you > + wouldn't have to access that class data directly > from an

Re: about perltoot

2006-09-24 Thread chen li
> Why didn't you test what happens when you do that? > What happens when you > create three different objects and manipulate them? > What happens with > those object when you go back to the original code? Actually before I post it I already check what happen. It looks like there are NO differe

Re: about perltoot

2006-09-24 Thread chen li
--- "Mumia W." <[EMAIL PROTECTED]> wrote: > On 09/22/2006 07:50 AM, chen li wrote: > > > > --- "Mumia W." > <[EMAIL PROTECTED]> > > wrote: > >> That "redundancy" allows you to use inheritance. > If > >> you

AUTOLOAD in perltoot

2006-09-22 Thread chen li
Hi all, I copy some codes from perltoot and write some lines to see how AUTOLOAD works. test.pl #!C:/Perl/bin/perl.exe use strict; use warnings; use Data::Dumper; use Person; my $obj=Person->new(); print $obj->name(); print Dumper $obj; # Person.pm in the s

Re: about perltoot

2006-09-22 Thread chen li
--- "Mumia W." <[EMAIL PROTECTED]> wrote: > On 09/21/2006 07:08 PM, chen li wrote: > > Hi all, > > > > I read some sections in perltoot. In section > > Autoloaded Data Methods I see some line codes as > > following: > > > > pa

about perltoot

2006-09-21 Thread chen li
Hi all, I read some sections in perltoot. In section Autoloaded Data Methods I see some line codes as following: package Person; use Carp; our $AUTOLOAD; # it's a package global my %fields = ( name=> undef, age => undef,

Re: search POD about AUTOLOAD

2006-09-21 Thread chen li
--- Jeff Pang <[EMAIL PROTECTED]> wrote: > > >I want to read some information about AUTOLOAD in > POD. > > Hi, > > Got these pieces from Schwartz's book and hope it > helps. Hi Jeff, Thank you very much, Li __ Do You Yahoo!? Tired of spam? Ya

Re: search POD about AUTOLOAD

2006-09-21 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > I want to read some information about AUTOLOAD in > POD. > > But I get nothing when I type "perldoc -f/-q > > AUTOLOAD". > > Any comments? > > perlsub has an "Autoloading" section: > > perldoc perlsub > > Also the "AUTOLOAD: Proxy Methods" s

search POD about AUTOLOAD

2006-09-20 Thread chen li
Hi all, I want to read some information about AUTOLOAD in POD. But I get nothing when I type "perldoc -f/-q AUTOLOAD". Any comments? Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.co

sprintf and printf in Perl

2006-09-14 Thread chen li
Hi all, First of all I want to thank you all for reading and replying my previous posts. Now I come across to another problem: I want to print out a AoA. If I use printf I get what I expect. If I use sprintf for string I get error messages but the remaining still look OK. But If use sprintf also

about map usage

2006-09-13 Thread chen li
Hi all, In perlfaq4.pod I see one line: my %hash = map { $_, 1 } @array; What is the usage of 1 in this code? Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsub

Re: Quick question on code factoring

2006-09-11 Thread chen li
> > It looks like you may want something like this: > > > > > > $id = $c->createLine( > > $x[0], $time1, > > $x[1], $time1, > > $color eq $B_COLOR ? () : ( > > $x[2], $time2, > > $x[3], $time2, > > ), > > -arrow => 'last'

Re: How to search POD

2006-09-11 Thread chen li
--- Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 9/11/06, chen li <[EMAIL PROTECTED]> wrote: > > > sometimes some PODs are very long I > > can't go back once I read to the end. The only > way I > > can go back is to issue the line code again. Is &

How to search POD

2006-09-11 Thread chen li
Dear all, There are several methods to search POD on window prompt by issuing the lines below: perldoc perl(get overview of Perl) perldoc -f map( search a function called map) perldoc -q regular expression (search a question about regular expression ) perldoc CGI( information about module CGI)

Re: Summary for mean/average calculation in perl

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

Re: usage of grep and map

2006-09-10 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > chen li wrote: > > > > --- Tom Phoenix <[EMAIL PROTECTED]> wrote: > > > >>The expression in a map is evaluated in a list > >>context. The list that > >>it returns is includ

Re: output not in current directory

2006-09-10 Thread chen li
What is the code for this from the > window > > > promt(not within the script itself)? > > > > > > c:\>perl test.pl >1(this will save the result in > the > > > current directory. > > > How about saving the result to c:/perl/self/?) > > > > > > Thanks, > > > > > > Li > > > > Hi Li, > > > > Google

Re: usage of grep and map

2006-09-10 Thread chen li
--- Rob Dixon <[EMAIL PROTECTED]> wrote: > > > > > > #!C:/Perl/bin/perl.exe > > > > use warnings; > > use strict; > > use Data::Dump qw(dump); > > > > > > my @data=( > > [1,2,3], > > [4,5,6], > > [7,8,9] > > ); > > > > my @reverse_map=map{[reverse @[EMAIL PRO

Re: Re: usage of grep and map

2006-09-10 Thread chen li
--- Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 9/10/06, chen li <[EMAIL PROTECTED]> wrote: > > > So map function returns the transformed or changed > > elements but not the original ones and grep still > > returns the original ones? > > The only

output not in current directory

2006-09-10 Thread chen li
Hi all, When I run scripts I want the result saved to a different directory instead of the current one on window xp. What is the code for this from the window promt(not within the script itself)? c:\>perl test.pl >1(this will save the result in the current directory. How about saving the result

Re: usage of grep and map

2006-09-10 Thread chen li
--- Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 9/10/06, chen li <[EMAIL PROTECTED]> wrote: > > > Although I read the usage for grep and map using > > perldoc -f grep or map I don't think I really get > the > > differences between them. > &

usage of grep and map

2006-09-10 Thread chen li
Hi all, Although I read the usage for grep and map using perldoc -f grep or map I don't think I really get the differences between them. I have a small data set: my @data=( [1,2,3], [4,5,6], [7,8,9] ); I want to reverse the elements in each row only but not

Re: Summary for mean/average calculation in perl

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

Summary for mean/average calculation in perl

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

Re: perl built in function for mean

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

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: regular expression question

2006-09-08 Thread chen li
--- David Romano <[EMAIL PROTECTED]> wrote: > chen li wrote on Thu, Sep 07, 2006 at 01:13:04PM > PDT: > > > > > One more question what if I have a file that > have > > > > different lines 1) some lines have number only > 2) > > > som

Re: regular expression question

2006-09-07 Thread chen li
> On 9/7/06, chen li <[EMAIL PROTECTED]> wrote: > > Hi Adriano, > > > > The line code you provide doesn't work on my > computer > > but based on what you say I change it into this > line > > code and it works. > > > On 9/7/06, Rob Dixon

Re: regular expression question

2006-09-06 Thread chen li
--- Adriano Ferreira <[EMAIL PROTECTED]> wrote: > On 9/6/06, chen li <[EMAIL PROTECTED]> wrote: > > I need a regular expression to process some data > but > > get stuck. I wonder if anyone here might have a > clue. > > > > input: > &g

regular expression question

2006-09-06 Thread chen li
Hello all, I need a regular expression to process some data but get stuck. I wonder if anyone here might have a clue. input: my $line='group A 1 2 3 4';# separated by space results: my @data=("group A ",1,2,3,4); Thanks, Li __ Do You Yahoo!

Re: how to delete elements in AoA

2006-09-05 Thread chen li
Hi guys, Thank you all for the input and this is a summary email. Question: How to paste data into a CGI script and then delete empty elements in AoA pasted data format: 1 1 1 2 2 2 3 3 3 expected AoA ([1,1,1], [2,2,2], [3,3,3], ); script/answer: my $cgi=CGI->new(); my $

Re: how to delete elements in AoA

2006-09-04 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > chen li wrote: > > > > --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > > >>chen li wrote: > >> > >>>Sorry to bother again. I get an AoA containi

how to delete elements in AoA

2006-09-03 Thread chen li
Hi guys, Sorry to bother again. I get an AoA containing empty elements like these: my @data=( [1,1,1], [2,2,2], [], [3,3,3], [] ); How can I remove the empty element in this AoA? Can I use grep function to do it? Thanks, Li __

process data into an array using CGI script

2006-09-02 Thread chen li
Dear all, I paste some data into textarea in a CGI script and use param('data')to retrieve the data. I want to pass the data into an array but what I find is that I only one dimensional array. Can someone here give me a hand? Thanks, Li data pasted into textarea: 1 1 1 2 2 2 3 3 3 (each colum

what is wrong with my script

2006-08-31 Thread chen li
Hi guys, I have a CGI script to process some data from the visitors. The input data takes this format(row x column): 1 2 4 5 6 7 100 90 50 30 20 0 After processing I want to print out the result in the same format(row x column). But when I ran

question about CGI module

2006-08-29 Thread chen li
Hi guys; What are the differences between these two code lines: use CGI; and use CGI qw/:standard/; Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail

empty line in REs

2006-08-22 Thread chen li
Hi all, Just a quick question: what is the line code for an empty line using regular expression in Perl? Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-ma

argument for Math::MatrixReal

2006-08-21 Thread chen li
Dear all, I read a file into an array reference. I want to pass it as an argument when create the new object from Math::MatrixReal. But when I read the usage of this module I can't find how. Does anyone there give me a hand? Thanks, Li Here are the code I use: my $ref_AoA=[ [1,

Re: String or numbers in AoA?

2006-08-21 Thread chen li
Thanks, Li --- Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 8/20/06, chen li <[EMAIL PROTECTED]> wrote: > > > my @temp=split(/t/, $line); > > Isn't there supposed to be a backslash in there? > Hope this helps! > > --Tom Phoenix > Stoneh

String or numbers in AoA?

2006-08-20 Thread chen li
Dear all, I try to read some records in one file. Each record consists of several column which are separated by tab and ends by "\n". What I would like to do is that to build an array of array so that each record is a reference to an anonymous array. Here is the format in the file: 1 2 3 1 2 3

String or numbers in AoA?

2006-08-20 Thread chen li
Dear all, I try to read some records in one file. Each record consists of several column which are separated by tab and ends by "\n". What I would like to do is that to build an array of array so that each record is a reference to an anonymous array. the format in the file takes this format: 1

log and ln formular in perl

2006-08-20 Thread chen li
Dear all, I want to get the value 2 out of log based on 10 or natural number e (the result is 0.301 and 0.609, respectively). What are the formular for these two caulculation and how can I find more about math stuff in perldoc? Many thanks, Li __

Re: calculate the value in an array of array

2006-08-19 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > > I have an array of array look like this: > > > > @array_of_array=( > > > > [1,2,3,4,5], > > [1,2,3,4,5], > > [1,2,3,4,5], > > [1,2,3,4,5] > > ) > > > > How do I get the total values for each c

calculate the value in an array of array

2006-08-18 Thread chen li
Dear all, I have an array of array look like this: @array_of_array=( [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5] ) How do I get the total values for each colume, such as $column1=1+1+1+1; $column2=2+2+2+2; $column3=3+3+3+3; ... Thanks,

Re: how to create a serial of array names in perl

2006-08-17 Thread chen li
--- Joshua Colson <[EMAIL PROTECTED]> wrote: > On Thu, 2006-08-17 at 14:21 -0700, chen li wrote: > > Dear all, > > > > Is it possible to create a serial of array name > using > > a loop, such as @array0,@array1, @array2, ..., to > > @array(n-1)? >

how to create a serial of array names in perl

2006-08-17 Thread chen li
Dear all, Is it possible to create a serial of array name using a loop, such as @array0,@array1, @array2, ..., to @array(n-1)? Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

line command in perl

2006-08-16 Thread chen li
Dear all, I want to find the usage of a specific function such as splice. Which line code am I supposed to issue? I tried perldoc splice or perldoc perlfunc splice but it didn't work. Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has th

Re: math module and array manipulation

2006-08-16 Thread chen li
--- David Greenberg <[EMAIL PROTECTED]> wrote: > I'm sure there's an easier/better way of doing this, > but in the interest of > simplicity, let's look at this approach: > > First, a red flag goes up when you say that you have > an array of 12 > numbers. Will it always be twelve? > > The seco

formular

2006-08-15 Thread chen li
Dear all, What is the formula of 2 to 4(the result is 16)in Perl? Thanks, Li __ 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 co

math module and array manipulation

2006-08-14 Thread chen li
Dear all, I have an array contains 12 numbers. I want to calculate the mean and standard deviation for very three numbers. I just wonder which math module is available to do the job. Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the

how to populate an 12x8 array from a data file

2006-08-14 Thread chen li
Dear all, I need to read a data file containing 96 records/lines and each record/line contains several columns separated by tab. I would like to extract the first column from each record only and put them into a 12x8 array. Here is the script I use to do the job but it seems I have some problems

Re: Trying to add hyperlink

2006-06-22 Thread chen li
--- Prabu <[EMAIL PROTECTED]> wrote: > Hello, > > Hope this is your need... > > #!/usr/bin/perl -w > use warnings ; > > use CGI qw/:standard/; > print header, start_html("Stsd ILO Links"), h1("Stsd > ILO Links") ; > > print table({-border=>undef,,-width=>'75%', > -height=>'70%'}, > caption(s

Re: How to create a new browser window using CGI

2006-06-08 Thread chen li
> Hello , > > Hope this work. > > #!c:/Perl/bin/perl.exe > use warnings; > use strict; > use CGI; > > my $query_obj=CGI->new(); > > #creat webpage > print $query_obj->header; > print $query_obj->start_html('My First Webpage'); > if (!$query_obj->param){ > print > $query_obj->start_

How to create a new browser window using CGI

2006-06-07 Thread chen li
Dear all, How can I add a line (lines) to the following script so that I can show the results on a new browser window after I press the submit button? Thanks, Li #!c:/Perl/bin/perl.exe use warnings; use strict; use CGI; my $query_obj=CGI->new(); #creat webpage print $query_obj->header; print

Re: What are the problems with my CGI script

2006-06-06 Thread chen li
--- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > chen li schreef: > > > my $name=$query_obj->param('text_field'); > > print $query_obj->p,"This is your name $name", > > "\n\n"; #line31 > > [...] > > Use o

What are the problems with my CGI script

2006-06-05 Thread chen li
Dear all, I just try a small CGI script. Although it displays no problem on the webpage there are two small errors in the script. I wonder if anyone here can help me figure out. And here is the script: #!c:/Perl/bin/perl.exe use warnings; use strict; use CGI; my $query_obj=CGI->new(); #creat we

Re: accessor problem in OO

2006-05-29 Thread chen li
--- Chad Perrin <[EMAIL PROTECTED]> wrote: > On Mon, May 29, 2006 at 01:17:52PM -0700, chen li > wrote: > > Sorry but what I mean is "Beginning Perl" from > > http://learn.perl.org/library/beginning_perl/ > > > > And BTW I have a hard copy of

Re: accessor problem in OO

2006-05-29 Thread chen li
Sorry but what I mean is "Beginning Perl" from http://learn.perl.org/library/beginning_perl/ And BTW I have a hard copy of "Learning Perl" by myself. Li --- "Randal L. Schwartz" wrote: > >>>>> "chen" == chen li <[EMAIL PROTEC

Re: accessor problem in OO

2006-05-29 Thread chen li
Hi Peter, Thank you very much, Li --- Peter Cornelius <[EMAIL PROTECTED]> wrote: > > On May 27, 2006, at 3:56 PM, chen li wrote: > > > > Based on what I learn the regular method to defer > a > > hash reference to get specific value takes this >

Re: accessor problem in OO

2006-05-27 Thread chen li
--- Peter Cornelius <[EMAIL PROTECTED]> wrote: > This might be a little more clear if you break down > the way arguments > are being passed in and what they actually are. It > sounds like > you're aware that the arguments are passed in as a > list name @_, it > looks like the arguments ar

accessor problem in OO

2006-05-27 Thread chen li
Hi all, I recently read chapter 11 about OOP from the online book "learning perl". Here are some example codes from chapeter 11: sub new{ my $class =shift; my [EMAIL PROTECTED]; bless ($self, $class); return $self } sub name{ #version 1 my

RE: format output from Data::Dumper

2006-05-16 Thread chen li
Hi all, I use the following script to find out the methods available from a class of Bio::Seq. #!c:/Perl/bin/Perl.exe use warnings; use strict; use Bio::Seq; use Data::Dumper; use Class::Inspector; my $methods=Class::Inspector->methods('Bio::Seq', 'full','public'); print Data::Dumper->Dump([$m

format output from Data::Dumper

2006-05-15 Thread chen li
Hi all, I get data from Data::Dumper in an array format. I just wonder if there is a means to format the content in alphabetic order, something like "sort keys or sort values". Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best

object-oriented perl mailing list

2006-05-12 Thread chen li
Hi all, I just wonder if there is a forum of objecte-oriented perl for the begginer. Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: array question

2006-05-09 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Mr. Shawn H. Corey wrote: > > On Tue, 2006-09-05 at 01:33 +0200, Paul Johnson > wrote: > >>Um, that's not quite correct. > >> > >>See `perldoc -f split` for details. > > > > Oh, yes, a special case. I have long ago abandoned > special cases since

Re: array question

2006-05-08 Thread chen li
> > I have an arry like this: > > > > @arry=('AA bb','BB','CC AG') > > > > How do I turn it into new array like this: > > > > @new_array=('AA','bb','BB','CC','AG') > > my @new_array = split ' ', "@arry"; Both line codes work perfectly: my @new_array = map { split } @arry; or my @new_array =

array question

2006-05-08 Thread chen li
Hi all, I have an arry like this: @arry=('AA bb','BB','CC AG') How do I turn it into new array like this: @new_array=('AA','bb','BB','CC','AG') Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around htt

Re: What is the function of BEGIN in perl

2006-05-02 Thread chen li
Thanks very much for Anthiny and others for the explanation. Li --- Anthony Ettinger <[EMAIL PROTECTED]> wrote: > basically, BEGIN { } is a block which gets called > whenever the script > begins. > > > > On 5/1/06, chen li <[EMAIL PROTECTED]> wrote: > >

What is the function of BEGIN in perl

2006-05-01 Thread chen li
Dear all, Recently I read some source codes of perl modules. I find some codes look like this: BEGIN {..} What is the function of BEGIN here? Thank you, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protect

Re: how to tell perl to look for where a new module is installed

2006-04-14 Thread chen li
--- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: > chen li wrote: > > Hi all, > > > > Thank you all for reply my post in advance. > > > > I install in new module like this: > > c:/perl/local/new.pm. > > > > How should

RE: how to tell perl to look for where a new module is installed

2006-04-14 Thread chen li
> use lib 'stuff/moo';" > > > > -Original Message- > From: chen li [mailto:[EMAIL PROTECTED] > Sent: Friday, April 14, 2006 3:15 PM > To: Timothy Johnson > Subject: RE: how to tell perl to look for where a > new module is > install

RE: reverse the order of a row in Excel

2006-04-14 Thread chen li
nd up > being to busy to help you, and 2) you're probably > not the first person > to have this problem, so it is good to get the > information out there for > other beginners. > > > > > -Original Message- > From: chen li [mailto:[EMAIL PROTECTED] > Sent: Friday

how to tell perl to look for where a new module is installed

2006-04-14 Thread chen li
Hi all, Thank you all for reply my post in advance. I install in new module like this: c:/perl/local/new.pm. How should tell the perl to look at it in addition to the default paths? Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best

row and column convert in perl

2006-04-14 Thread chen li
Hi all, I have a two dimensional array: $array=([1,2,3,4,5,], [10,20,30,40,50]) How could I change so that I will get the following results using perl? $change_array=([1,10], [2,20], [3,30], [4,40], [5,50]) Thanks, Li

reverse the order of a row in Excel

2006-04-10 Thread chen li
Dear all, I know this question has nothing to do perl. But I just wonder if anyone out there knows how to reverse the order of a row in Excel. Here is the example: I have a row of data: 1, 0, 4, 5 in Excel but I would like to reverse its order so that I get data row like these: 5,4,0,1. If I jus

somthing wrong with my codes???

2006-01-20 Thread chen li
Hi all, I write a small script for practice purpose. I have a string line in this format: $string="password=xyz verbose=9 score=0"; I want to parse out password, verbose, and score into one array and xyz, 9 and 0 into another array. But I don't get what I expect. I just wonder what is wrong? Tha

Re: new for reading file containing multiple records

2006-01-08 Thread chen li
Hi Shawn, Thanks for the detailed explanations. But Edward(see one of posts in my thread) tells me to try Bio::SeqIO from www.bioperl.org. After I try I think it is what I really need. Once again thank you so much for the help. Li __

Re: new for reading file containing multiple records

2006-01-07 Thread chen li
Hi Tom, Thanks for the reply. > Although it's tempting to set $/ to "\n>" for the > file format you > describe, that's probably not correct for the first > or last record in > your file. You are 50% right. This method is not correct for the first record(which actually contains ">' only) but it

Re: new for reading file containing multiple records

2006-01-06 Thread chen li
Hi Shawn, I use the your code to do the job: #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $filename='sequence.fasta'; open (DATA,$filename) or die; {local $/ = '>'; while( ){ print Dumper \$_; } } exit; And I get the following output: $VAR1 = \'>'; $VAR1 =

Re: new for reading file containing multiple records

2006-01-06 Thread chen li
> Word wrapping possibly mangled the example records, > could you please > upload a handful of them in a file somewhere? > > -- fxn Hi, I am just a newbie. What is word wrapping? Is it a perl module or something else? Thanks, Li

Re: new for reading file containing multiple records

2006-01-06 Thread chen li
ude the > leading '>' though. > } > } > Dont know if this can go smoothly with your 2.7G > file though. Good > luck, > XC > = > > Chen Li wrote: > > Hi all, > > > > I have a big file (2.

  1   2   >