Re: Newbie queries

2011-01-27 Thread John W. Krahn
dolphin wrote: Hi, Hello, Correct me that the "2" in the following means read? : my ( $label, $value ) = split /,/, $line, 2; The third argument to split determines how many list elements will be returned. For example, if: my $line = 'one,two,three,four,five,six,seven'; Then: split /

Re: Newbie queries

2011-01-27 Thread Octavian Rasnita
From: "dolphin" Hi, Correct me that the "2" in the following means read? : my ( $label, $value ) = split /,/, $line, 2; 2 means that the result of the split() function will be a list with 2 elements. You could also use the split() function without that third parameter that specifies the nu

Re: Newbie queries

2011-01-27 Thread dolphin
On Jan 25, 6:43 pm, orasn...@gmail.com ("Octavian Rasnita") wrote: > From: "dolphin" > > > > > > > > > > > Hi, > > > I'm learning perl now and would like to find out how to perform the > > following if given in a text file? > > > ,12 > > ,437 > > ,124 > > ,45 > > ,789 > > ,

Re: Newbie queries

2011-01-25 Thread Mariano Loza Coll
On Tue, Jan 25, 2011 at 2:43 AM, Octavian Rasnita wrote: > From: "dolphin" >> >> Hi, >> >> I'm learning perl now and would like to find out how to perform the >> following if given in a text file? >> >> >> ,12 >> ,437 >> ,124 >> ,45 >> ,789 >> ,67 >> CCC,567 >> DDD,5 >> >>

Re: Newbie queries

2011-01-25 Thread Octavian Rasnita
From: "dolphin" Hi, I'm learning perl now and would like to find out how to perform the following if given in a text file? ,12 ,437 ,124 ,45 ,789 ,67 CCC,567 DDD,5 How to sum up the 2nd column based on the 1st column with the following result: : BBB: CCC: DDD:

Newbie queries

2011-01-25 Thread dolphin
Hi, I'm learning perl now and would like to find out how to perform the following if given in a text file? ,12 ,437 ,124 ,45 ,789 ,67 CCC,567 DDD,5 How to sum up the 2nd column based on the 1st column with the following result: : BBB: CCC: DDD: Thanks in advance