Re: list-parsing problem

2003-10-06 Thread Steve Grazzini
On Tue, Oct 07, 2003 at 01:09:26AM +0200, Kevin Pfeiffer wrote: > I just noticed that: > > print join ", ", @list, "\n"; > > produces output such as: > > a, > a, b, c, > > whereas: > > print join(", ", @list), "\n"; > > produces: > > a > a, b, c > > (no trailing comma) -- strange... I think

RE: list-parsing problem

2003-10-06 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Thomas bätzler wrote: > Marcus Claesson [mailto:[EMAIL PROTECTED] asked: >> I have a silly little list-parsing problem that I can't get my head >> around, and I'm sure some of you have come across it before. > > Sure. Looks like homework ;-) No, the homework I've

Re: list-parsing problem

2003-09-19 Thread John W. Krahn
Marcus Claesson wrote: > > Hi People, Hello, > I have a silly little list-parsing problem that I can't get my head > around, and I'm sure some of you have come across it before. > > I have a list like this: > > 1 a > 2 b > 2 c > 3 a > 4 d > 4 d > 4 e >

RE: list-parsing problem

2003-09-19 Thread EUROSPACE SZARINDAR
e looking for that , no ? 2 b,c 3 a 4 d,e,f 5 g 8f Look at the "perldoc -f sort" to have the numerical order Michel -Message d'origine- De: Marcus Claesson [mailto:[EMAIL PROTECTED] Date: jeudi 18 septembre 2003 11:56 À: Thomas Bätzler Cc:

RE: list-parsing problem

2003-09-19 Thread Thomas Bätzler
Marcus Claesson [mailto:[EMAIL PROTECTED] asked: > I have a silly little list-parsing problem that I can't get my head > around, and I'm sure some of you have come across it before. Sure. Looks like homework ;-) HTH, Thomas #!/usr/bin/perl -w use strict; my %unique; while( ){ my( $key, $va

RE: list-parsing problem

2003-09-19 Thread EUROSPACE SZARINDAR
Hi Marcus Just look at the perldoc perlreftut. What you are looking for is the exact exemple of the paper. Michel -Message d'origine- De: Marcus Claesson [mailto:[EMAIL PROTECTED] Date: jeudi 18 septembre 2003 11:26 À: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Objet: li

Re: list-parsing problem

2003-09-18 Thread Gary Stainburn
On Thursday 18 Sep 2003 10:26 am, Marcus Claesson wrote: > Hi People, > > I have a silly little list-parsing problem that I can't get my head > around, and I'm sure some of you have come across it before. > > I have a list like this: > > 1 a > 2 b > 2 c > 3 a > 4 d > 4 d > 4

RE: list-parsing problem

2003-09-18 Thread Charles K. Clarkson
Marcus Claesson <[EMAIL PROTECTED]> : : But I just have one question before trying it out. : Isn't the key order in a hash randomised, which in : this case means I wouldn't get first column in : numerical order as I wanted? You didn't state what order in the problem not did you say that the f

RE: list-parsing problem

2003-09-18 Thread Marcus Claesson
Homework's sorted ;)! Thanks a lot Thomas, it worked fine! Marcus On Thu, 2003-09-18 at 10:41, Thomas Bätzler wrote: > Marcus Claesson [mailto:[EMAIL PROTECTED] asked: > > I have a silly little list-parsing problem that I can't get my head > > around, and I'm sure some of you have come across it b

RE: list-parsing problem

2003-09-18 Thread Charles K. Clarkson
Marcus Claesson <[EMAIL PROTECTED]> wrote : : I have a silly little list-parsing problem that I can't get : my head around, and I'm sure some of you have come across : it before. : : I have a list like this: : : 1 a : 2 b : 2 c : 3 a : 4 d : 4 d : 4 e : 4 f : 5

RE: list-parsing problem

2003-09-18 Thread Marcus Claesson
Thanks Michel, I found it! But I just have one question before trying it out. Isn't the key order in a hash randomised, which in this case means I wouldn't get first column in numerical order as I wanted? Marcus On Thu, 2003-09-18 at 10:31, EUROSPACE SZARINDAR wrote: > Hi Marcus > > Just look

RE: list-parsing problem

2003-09-18 Thread Stephen Hardisty
Two dimensional hash perhaps? Where the first column is the first dimension and the second is, well, the second. E.g. while() { ($col1, $col2) = split(/$delimeter/, chomp($_)); $blah{$col1}{$col2} = 1; } Hope this helps. _